Class: Google::Apis::ApikeysV2::ApiKeysServiceService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::ApikeysV2::ApiKeysServiceService
- Defined in:
- lib/google/apis/apikeys_v2/service.rb
Overview
API Keys API
Manages the API keys associated with developer projects.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://apikeys.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#create_project_location_key(parent, v2_key_object = nil, key_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::Operation
Creates a new API key.
-
#delete_project_location_key(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::Operation
Deletes an API key.
-
#get_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::Operation
Gets the latest state of a long-running operation.
-
#get_project_location_key(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::V2Key
Gets the metadata for an API key.
-
#get_project_location_key_key_string(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::V2GetKeyStringResponse
Get the key string for an API key.
-
#initialize ⇒ ApiKeysServiceService
constructor
A new instance of ApiKeysServiceService.
-
#list_project_location_keys(parent, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::V2ListKeysResponse
Lists the API keys owned by a project.
-
#lookup_key_key(key_string: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::V2LookupKeyResponse
Find the parent project and resource name of the API key that matches the key string in the request.
-
#patch_project_location_key(name, v2_key_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::Operation
Patches the modifiable fields of an API key.
-
#undelete_project_location_key(name, v2_undelete_key_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::Operation
Undeletes an API key which was deleted within 30 days.
Constructor Details
#initialize ⇒ ApiKeysServiceService
Returns a new instance of ApiKeysServiceService.
47 48 49 50 51 52 |
# File 'lib/google/apis/apikeys_v2/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-apikeys_v2', client_version: Google::Apis::ApikeysV2::GEM_VERSION) @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 'lib/google/apis/apikeys_v2/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.
45 46 47 |
# File 'lib/google/apis/apikeys_v2/service.rb', line 45 def quota_user @quota_user end |
Instance Method Details
#create_project_location_key(parent, v2_key_object = nil, key_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::Operation
Creates a new API key. NOTE: Key is a global resource; hence the only
supported value for location is global
.
147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/google/apis/apikeys_v2/service.rb', line 147 def create_project_location_key(parent, v2_key_object = nil, key_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2/{+parent}/keys', ) command.request_representation = Google::Apis::ApikeysV2::V2Key::Representation command.request_object = v2_key_object command.response_representation = Google::Apis::ApikeysV2::Operation::Representation command.response_class = Google::Apis::ApikeysV2::Operation command.params['parent'] = parent unless parent.nil? command.query['keyId'] = key_id unless key_id.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_project_location_key(name, etag: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::Operation
Deletes an API key. Deleted key can be retrieved within 30 days of deletion.
Afterward, key will be purged from the project. NOTE: Key is a global resource;
hence the only supported value for location is global
.
185 186 187 188 189 190 191 192 193 194 |
# File 'lib/google/apis/apikeys_v2/service.rb', line 185 def delete_project_location_key(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v2/{+name}', ) command.response_representation = Google::Apis::ApikeysV2::Operation::Representation command.response_class = Google::Apis::ApikeysV2::Operation command.params['name'] = name unless name.nil? command.query['etag'] = etag unless etag.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::Operation
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
108 109 110 111 112 113 114 115 116 |
# File 'lib/google/apis/apikeys_v2/service.rb', line 108 def get_operation(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/{+name}', ) command.response_representation = Google::Apis::ApikeysV2::Operation::Representation command.response_class = Google::Apis::ApikeysV2::Operation command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_project_location_key(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::V2Key
Gets the metadata for an API key. The key string of the API key isn't included
in the response. NOTE: Key is a global resource; hence the only supported
value for location is global
.
218 219 220 221 222 223 224 225 226 |
# File 'lib/google/apis/apikeys_v2/service.rb', line 218 def get_project_location_key(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/{+name}', ) command.response_representation = Google::Apis::ApikeysV2::V2Key::Representation command.response_class = Google::Apis::ApikeysV2::V2Key command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_project_location_key_key_string(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::V2GetKeyStringResponse
Get the key string for an API key. NOTE: Key is a global resource; hence the
only supported value for location is global
.
249 250 251 252 253 254 255 256 257 |
# File 'lib/google/apis/apikeys_v2/service.rb', line 249 def get_project_location_key_key_string(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/{+name}/keyString', ) command.response_representation = Google::Apis::ApikeysV2::V2GetKeyStringResponse::Representation command.response_class = Google::Apis::ApikeysV2::V2GetKeyStringResponse command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_project_location_keys(parent, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::V2ListKeysResponse
Lists the API keys owned by a project. The key string of the API key isn't
included in the response. NOTE: Key is a global resource; hence the only
supported value for location is global
.
288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/google/apis/apikeys_v2/service.rb', line 288 def list_project_location_keys(parent, page_size: nil, page_token: nil, show_deleted: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/{+parent}/keys', ) command.response_representation = Google::Apis::ApikeysV2::V2ListKeysResponse::Representation command.response_class = Google::Apis::ApikeysV2::V2ListKeysResponse command.params['parent'] = parent unless parent.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['showDeleted'] = show_deleted unless show_deleted.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#lookup_key_key(key_string: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::V2LookupKeyResponse
Find the parent project and resource name of the API key that matches the key
string in the request. If the API key has been purged, resource name will not
be set. The service account must have the apikeys.keys.lookup
permission on
the parent project.
77 78 79 80 81 82 83 84 85 |
# File 'lib/google/apis/apikeys_v2/service.rb', line 77 def lookup_key_key(key_string: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/keys:lookupKey', ) command.response_representation = Google::Apis::ApikeysV2::V2LookupKeyResponse::Representation command.response_class = Google::Apis::ApikeysV2::V2LookupKeyResponse command.query['keyString'] = key_string unless key_string.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#patch_project_location_key(name, v2_key_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::Operation
Patches the modifiable fields of an API key. The key string of the API key isn'
t included in the response. NOTE: Key is a global resource; hence the only
supported value for location is global
.
334 335 336 337 338 339 340 341 342 343 344 345 |
# File 'lib/google/apis/apikeys_v2/service.rb', line 334 def patch_project_location_key(name, v2_key_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v2/{+name}', ) command.request_representation = Google::Apis::ApikeysV2::V2Key::Representation command.request_object = v2_key_object command.response_representation = Google::Apis::ApikeysV2::Operation::Representation command.response_class = Google::Apis::ApikeysV2::Operation command.params['name'] = name unless name.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#undelete_project_location_key(name, v2_undelete_key_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ApikeysV2::Operation
Undeletes an API key which was deleted within 30 days. NOTE: Key is a global
resource; hence the only supported value for location is global
.
369 370 371 372 373 374 375 376 377 378 379 |
# File 'lib/google/apis/apikeys_v2/service.rb', line 369 def undelete_project_location_key(name, v2_undelete_key_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2/{+name}:undelete', ) command.request_representation = Google::Apis::ApikeysV2::V2UndeleteKeyRequest::Representation command.request_object = v2_undelete_key_request_object command.response_representation = Google::Apis::ApikeysV2::Operation::Representation command.response_class = Google::Apis::ApikeysV2::Operation command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |