Class: Google::Apis::WebfontsV1::WebfontsService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::WebfontsV1::WebfontsService
- 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).
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
-
#user_ip ⇒ String
IP address of the site where the request originates.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#initialize ⇒ WebfontsService
constructor
A new instance of WebfontsService.
-
#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.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ WebfontsService
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
#key ⇒ String
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.
40 41 42 |
# File 'generated/google/apis/webfonts_v1/service.rb', line 40 def key @key end |
#quota_user ⇒ String
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.
46 47 48 |
# File 'generated/google/apis/webfonts_v1/service.rb', line 46 def quota_user @quota_user end |
#user_ip ⇒ String
Returns 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
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', ) 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 |