Class: Google::Apis::WebfontsV1::WebfontsService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/webfonts_v1/service.rb

Overview

Google Fonts Developer API

Accesses the metadata for all families served by Google Fonts, providing a list of families currently available (including available styles and a list of supported script subsets).

Examples:

require 'google/apis/webfonts_v1'

Webfonts = Google::Apis::WebfontsV1 # Alias the module
service = Webfonts::WebfontsService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeWebfontsService

Returns a new instance of WebfontsService



51
52
53
54
# File 'generated/google/apis/webfonts_v1/service.rb', line 51

def initialize
  super('https://www.googleapis.com/', 'webfonts/v1/')
  @batch_path = 'batch/webfonts/v1'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



40
41
42
# File 'generated/google/apis/webfonts_v1/service.rb', line 40

def key
  @key
end

#quota_userString

Returns An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Returns:

  • (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.



45
46
47
# File 'generated/google/apis/webfonts_v1/service.rb', line 45

def quota_user
  @quota_user
end

#user_ipString

Returns Deprecated. Please use quotaUser instead.

Returns:

  • (String)

    Deprecated. Please use quotaUser instead.



49
50
51
# File 'generated/google/apis/webfonts_v1/service.rb', line 49

def user_ip
  @user_ip
end

Instance Method Details

#list_webfonts(sort: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebfontsV1::WebfontList

Retrieves the list of fonts currently served by the Google Fonts Developer API

Parameters:

  • sort (String)

    Enables sorting of the list

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



78
79
80
81
82
83
84
85
86
87
# File 'generated/google/apis/webfonts_v1/service.rb', line 78

def list_webfonts(sort: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, 'webfonts', options)
  command.response_representation = Google::Apis::WebfontsV1::WebfontList::Representation
  command.response_class = Google::Apis::WebfontsV1::WebfontList
  command.query['sort'] = sort unless sort.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end