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


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


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

def key
  @key
end

#quota_userString


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

def quota_user
  @quota_user
end

#user_ipString


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

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

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