Class: Google::Apis::DiscoveryV1::DiscoveryService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/discovery_v1/service.rb

Overview

API Discovery Service

Provides information about other Google APIs, such as what APIs are available, the resource, and method details for each API.

Examples:

require 'google/apis/discovery_v1'

Discovery = Google::Apis::DiscoveryV1 # Alias the module
service = Discovery::DiscoveryService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://www.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDiscoveryService

Returns a new instance of DiscoveryService.



52
53
54
55
56
57
# File 'lib/google/apis/discovery_v1/service.rb', line 52

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, 'discovery/v1/',
        client_name: 'google-apis-discovery_v1',
        client_version: Google::Apis::DiscoveryV1::GEM_VERSION)
  @batch_path = 'batch/discovery/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.



41
42
43
# File 'lib/google/apis/discovery_v1/service.rb', line 41

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.



46
47
48
# File 'lib/google/apis/discovery_v1/service.rb', line 46

def quota_user
  @quota_user
end

#user_ipString

Returns Deprecated. Please use quotaUser instead.

Returns:

  • (String)

    Deprecated. Please use quotaUser instead.



50
51
52
# File 'lib/google/apis/discovery_v1/service.rb', line 50

def user_ip
  @user_ip
end

Instance Method Details

#get_rest_api(api, version, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DiscoveryV1::RestDescription

Retrieve the description of a particular version of an api.

Parameters:

  • api (String)

    The name of the API.

  • version (String)

    The version of the API.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



83
84
85
86
87
88
89
90
91
92
93
# File 'lib/google/apis/discovery_v1/service.rb', line 83

def get_rest_api(api, version, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'apis/{api}/{version}/rest', options)
  command.response_representation = Google::Apis::DiscoveryV1::RestDescription::Representation
  command.response_class = Google::Apis::DiscoveryV1::RestDescription
  command.params['api'] = api unless api.nil?
  command.params['version'] = version unless version.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

#list_apis(name: nil, preferred: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::DiscoveryV1::DirectoryList

Retrieve the list of APIs supported at this endpoint.

Parameters:

  • name (String) (defaults to: nil)

    Only include APIs with the given name.

  • preferred (Boolean) (defaults to: nil)

    Return only the preferred version of an API.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

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

  • user_ip (String) (defaults to: nil)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



119
120
121
122
123
124
125
126
127
128
129
# File 'lib/google/apis/discovery_v1/service.rb', line 119

def list_apis(name: nil, preferred: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command = make_simple_command(:get, 'apis', options)
  command.response_representation = Google::Apis::DiscoveryV1::DirectoryList::Representation
  command.response_class = Google::Apis::DiscoveryV1::DirectoryList
  command.query['name'] = name unless name.nil?
  command.query['preferred'] = preferred unless preferred.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