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



53
54
55
56
# File 'generated/google/apis/webfonts_v1/service.rb', line 53

def initialize
  super('https://www.googleapis.com/', 'webfonts/v1/')
  @batch_path = 'batch'
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 Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.



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

def quota_user
  @quota_user
end

#user_ipString

Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Returns:

  • (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.



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

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)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.

  • user_ip (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



82
83
84
85
86
87
88
89
90
91
# File 'generated/google/apis/webfonts_v1/service.rb', line 82

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