Class: Google::Apis::MybusinessaccountmanagementV1::MyBusinessAccountManagementService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::MybusinessaccountmanagementV1::MyBusinessAccountManagementService
- Defined in:
- lib/google/apis/mybusinessaccountmanagement_v1/service.rb
Overview
My Business Account Management API
The My Business Account Management API provides an interface for managing access to a location on Google. Note - If you have a quota of 0 after enabling the API, please request for GBP API access.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://mybusinessaccountmanagement.$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
-
#accept_invitation(name, accept_invitation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Empty
Accepts the specified invitation.
-
#create_account(account_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Account
Creates an account with the specified name and type under the given parent.
-
#create_account_admin(parent, admin_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Admin
Invites the specified user to become an administrator for the specified account.
-
#create_location_admin(parent, admin_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Admin
Invites the specified user to become an administrator for the specified location.
-
#decline_invitation(name, decline_invitation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Empty
Declines the specified invitation.
-
#delete_account_admin(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Empty
Removes the specified admin from the specified account.
-
#delete_location_admin(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Empty
Removes the specified admin as a manager of the specified location.
-
#get_account(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Account
Gets the specified account.
-
#initialize ⇒ MyBusinessAccountManagementService
constructor
A new instance of MyBusinessAccountManagementService.
-
#list_account_admins(parent, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::ListAccountAdminsResponse
Lists the admins for the specified account.
-
#list_account_invitations(parent, filter: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::ListInvitationsResponse
Lists pending invitations for the specified account.
-
#list_accounts(filter: nil, page_size: nil, page_token: nil, parent_account: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::ListAccountsResponse
Lists all of the accounts for the authenticated user.
-
#list_location_admins(parent, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::ListLocationAdminsResponse
Lists all of the admins for the specified location.
-
#patch_account(name, account_object = nil, update_mask: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Account
Updates the specified business account.
-
#patch_account_admin(name, admin_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Admin
Updates the Admin for the specified Account Admin.
-
#patch_location_admin(name, admin_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Admin
Updates the Admin for the specified location.
-
#transfer_location(name, transfer_location_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Empty
Moves a location from an account that the user owns to another account that the same user administers.
Constructor Details
#initialize ⇒ MyBusinessAccountManagementService
Returns a new instance of MyBusinessAccountManagementService.
49 50 51 52 53 54 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 49 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-mybusinessaccountmanagement_v1', client_version: Google::Apis::MybusinessaccountmanagementV1::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.
42 43 44 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 42 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.
47 48 49 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 47 def quota_user @quota_user end |
Instance Method Details
#accept_invitation(name, accept_invitation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Empty
Accepts the specified invitation.
373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 373 def accept_invitation(name, accept_invitation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:accept', ) command.request_representation = Google::Apis::MybusinessaccountmanagementV1::AcceptInvitationRequest::Representation command.request_object = accept_invitation_request_object command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Empty::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Empty 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 |
#create_account(account_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Account
Creates an account with the specified name and type under the given parent. - Personal accounts and Organizations cannot be created. - User Groups cannot be created with a Personal account as primary owner. - Location Groups cannot be created with a primary owner of a Personal account if the Personal account is in an Organization. - Location Groups cannot own Location Groups.
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 79 def create_account(account_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/accounts', ) command.request_representation = Google::Apis::MybusinessaccountmanagementV1::Account::Representation command.request_object = account_object command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Account::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Account command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_account_admin(parent, admin_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Admin
Invites the specified user to become an administrator for the specified account. The invitee must accept the invitation in order to be granted access to the account. See AcceptInvitation to programmatically accept an invitation.
237 238 239 240 241 242 243 244 245 246 247 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 237 def create_account_admin(parent, admin_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/admins', ) command.request_representation = Google::Apis::MybusinessaccountmanagementV1::Admin::Representation command.request_object = admin_object command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Admin::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Admin command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_location_admin(parent, admin_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Admin
Invites the specified user to become an administrator for the specified location. The invitee must accept the invitation in order to be granted access to the location. See AcceptInvitation to programmatically accept an invitation.
514 515 516 517 518 519 520 521 522 523 524 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 514 def create_location_admin(parent, admin_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/admins', ) command.request_representation = Google::Apis::MybusinessaccountmanagementV1::Admin::Representation command.request_object = admin_object command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Admin::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Admin command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#decline_invitation(name, decline_invitation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Empty
Declines the specified invitation.
407 408 409 410 411 412 413 414 415 416 417 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 407 def decline_invitation(name, decline_invitation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:decline', ) command.request_representation = Google::Apis::MybusinessaccountmanagementV1::DeclineInvitationRequest::Representation command.request_object = decline_invitation_request_object command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Empty::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Empty 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 |
#delete_account_admin(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Empty
Removes the specified admin from the specified account.
270 271 272 273 274 275 276 277 278 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 270 def delete_account_admin(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Empty::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Empty 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 |
#delete_location_admin(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Empty
Removes the specified admin as a manager of the specified location.
546 547 548 549 550 551 552 553 554 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 546 def delete_location_admin(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Empty::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Empty 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_account(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Account
Gets the specified account. Returns NOT_FOUND
if the account does not exist
or if the caller does not have access rights to it.
111 112 113 114 115 116 117 118 119 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 111 def get_account(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Account::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Account 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_account_admins(parent, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::ListAccountAdminsResponse
Lists the admins for the specified account.
301 302 303 304 305 306 307 308 309 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 301 def list_account_admins(parent, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/admins', ) command.response_representation = Google::Apis::MybusinessaccountmanagementV1::ListAccountAdminsResponse::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::ListAccountAdminsResponse command.params['parent'] = parent unless parent.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_account_invitations(parent, filter: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::ListInvitationsResponse
Lists pending invitations for the specified account.
443 444 445 446 447 448 449 450 451 452 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 443 def list_account_invitations(parent, filter: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/invitations', ) command.response_representation = Google::Apis::MybusinessaccountmanagementV1::ListInvitationsResponse::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::ListInvitationsResponse command.params['parent'] = parent unless parent.nil? command.query['filter'] = filter unless filter.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_accounts(filter: nil, page_size: nil, page_token: nil, parent_account: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::ListAccountsResponse
Lists all of the accounts for the authenticated user. This includes all accounts that the user owns, as well as any accounts for which the user has management rights.
158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 158 def list_accounts(filter: nil, page_size: nil, page_token: nil, parent_account: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/accounts', ) command.response_representation = Google::Apis::MybusinessaccountmanagementV1::ListAccountsResponse::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::ListAccountsResponse command.query['filter'] = filter unless filter.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['parentAccount'] = parent_account unless parent_account.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_location_admins(parent, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::ListLocationAdminsResponse
Lists all of the admins for the specified location.
577 578 579 580 581 582 583 584 585 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 577 def list_location_admins(parent, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+parent}/admins', ) command.response_representation = Google::Apis::MybusinessaccountmanagementV1::ListLocationAdminsResponse::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::ListLocationAdminsResponse command.params['parent'] = parent unless parent.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_account(name, account_object = nil, update_mask: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Account
Updates the specified business account. Personal accounts cannot be updated using this method.
199 200 201 202 203 204 205 206 207 208 209 210 211 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 199 def patch_account(name, account_object = nil, update_mask: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', ) command.request_representation = Google::Apis::MybusinessaccountmanagementV1::Account::Representation command.request_object = account_object command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Account::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Account command.params['name'] = name unless name.nil? command.query['updateMask'] = update_mask unless update_mask.nil? command.query['validateOnly'] = validate_only unless validate_only.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_account_admin(name, admin_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Admin
Updates the Admin for the specified Account Admin.
338 339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 338 def patch_account_admin(name, admin_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', ) command.request_representation = Google::Apis::MybusinessaccountmanagementV1::Admin::Representation command.request_object = admin_object command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Admin::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Admin 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 |
#patch_location_admin(name, admin_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Admin
Updates the Admin for the specified location. Only the AdminRole of the Admin can be updated.
615 616 617 618 619 620 621 622 623 624 625 626 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 615 def patch_location_admin(name, admin_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', ) command.request_representation = Google::Apis::MybusinessaccountmanagementV1::Admin::Representation command.request_object = admin_object command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Admin::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Admin 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 |
#transfer_location(name, transfer_location_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessaccountmanagementV1::Empty
Moves a location from an account that the user owns to another account that the same user administers. The user must be an owner of the account the location is currently associated with and must also be at least a manager of the destination account.
478 479 480 481 482 483 484 485 486 487 488 |
# File 'lib/google/apis/mybusinessaccountmanagement_v1/service.rb', line 478 def transfer_location(name, transfer_location_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:transfer', ) command.request_representation = Google::Apis::MybusinessaccountmanagementV1::TransferLocationRequest::Representation command.request_object = transfer_location_request_object command.response_representation = Google::Apis::MybusinessaccountmanagementV1::Empty::Representation command.response_class = Google::Apis::MybusinessaccountmanagementV1::Empty 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 |