Skip to content

Commit

Permalink
feat(mybusinessaccountmanagement): update the API
Browse files Browse the repository at this point in the history
#### mybusinessaccountmanagement:v1

The following keys were added:
- resources.locations.methods.transferLocation.description
- resources.locations.methods.transferLocation.flatPath
- resources.locations.methods.transferLocation.httpMethod
- resources.locations.methods.transferLocation.id
- resources.locations.methods.transferLocation.parameterOrder
- resources.locations.methods.transferLocation.parameters.locationsId.location
- resources.locations.methods.transferLocation.parameters.locationsId.required
- resources.locations.methods.transferLocation.parameters.locationsId.type
- resources.locations.methods.transferLocation.path
- resources.locations.methods.transferLocation.request.$ref
- resources.locations.methods.transferLocation.response.$ref
- schemas.TransferLocationRequest.description
- schemas.TransferLocationRequest.id
- schemas.TransferLocationRequest.properties.destinationAccount.description
- schemas.TransferLocationRequest.properties.destinationAccount.type
- schemas.TransferLocationRequest.properties.name.description
- schemas.TransferLocationRequest.properties.name.type
- schemas.TransferLocationRequest.type
  • Loading branch information
yoshi-automation authored and sofisl committed Apr 5, 2021
1 parent d6e98b3 commit b48400f
Show file tree
Hide file tree
Showing 2 changed files with 203 additions and 1 deletion.
42 changes: 41 additions & 1 deletion discovery/mybusinessaccountmanagement-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,31 @@
}
},
"locations": {
"methods": {
"transferLocation": {
"description": "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.",
"flatPath": "v1/locations/{locationsId}:transferLocation",
"httpMethod": "POST",
"id": "mybusinessaccountmanagement.locations.transferLocation",
"parameterOrder": [
"locationsId"
],
"parameters": {
"locationsId": {
"location": "path",
"required": true,
"type": "string"
}
},
"path": "v1/locations/{locationsId}:transferLocation",
"request": {
"$ref": "TransferLocationRequest"
},
"response": {
"$ref": "Empty"
}
}
},
"resources": {
"admins": {
"methods": {
Expand Down Expand Up @@ -503,7 +528,7 @@
}
}
},
"revision": "20210307",
"revision": "20210330",
"rootUrl": "https://mybusinessaccountmanagement.googleapis.com/",
"schemas": {
"AcceptInvitationRequest": {
Expand Down Expand Up @@ -884,6 +909,21 @@
}
},
"type": "object"
},
"TransferLocationRequest": {
"description": "Request message for AccessControl.TransferLocation.",
"id": "TransferLocationRequest",
"properties": {
"destinationAccount": {
"description": "Required. Name of the account resource to transfer the location to (for example, \"accounts/{account}\").",
"type": "string"
},
"name": {
"description": "Required. The name of the location to transfer. `locations/{location_id}`.",
"type": "string"
}
},
"type": "object"
}
},
"servicePath": "",
Expand Down
162 changes: 162 additions & 0 deletions src/apis/mybusinessaccountmanagement/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,19 @@ export namespace mybusinessaccountmanagement_v1 {
*/
locationName?: string | null;
}
/**
* Request message for AccessControl.TransferLocation.
*/
export interface Schema$TransferLocationRequest {
/**
* Required. Name of the account resource to transfer the location to (for example, "accounts/{account\}").
*/
destinationAccount?: string | null;
/**
* Required. The name of the location to transfer. `locations/{location_id\}`.
*/
name?: string | null;
}

export class Resource$Accounts {
context: APIRequestContext;
Expand Down Expand Up @@ -2051,6 +2064,155 @@ export namespace mybusinessaccountmanagement_v1 {
this.context = context;
this.admins = new Resource$Locations$Admins(this.context);
}

/**
* 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.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/mybusinessaccountmanagement.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const mybusinessaccountmanagement = google.mybusinessaccountmanagement('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: [],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await mybusinessaccountmanagement.locations.transferLocation({
* locationsId: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "destinationAccount": "my_destinationAccount",
* // "name": "my_name"
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {}
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
transferLocation(
params: Params$Resource$Locations$Transferlocation,
options: StreamMethodOptions
): GaxiosPromise<Readable>;
transferLocation(
params?: Params$Resource$Locations$Transferlocation,
options?: MethodOptions
): GaxiosPromise<Schema$Empty>;
transferLocation(
params: Params$Resource$Locations$Transferlocation,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
transferLocation(
params: Params$Resource$Locations$Transferlocation,
options: MethodOptions | BodyResponseCallback<Schema$Empty>,
callback: BodyResponseCallback<Schema$Empty>
): void;
transferLocation(
params: Params$Resource$Locations$Transferlocation,
callback: BodyResponseCallback<Schema$Empty>
): void;
transferLocation(callback: BodyResponseCallback<Schema$Empty>): void;
transferLocation(
paramsOrCallback?:
| Params$Resource$Locations$Transferlocation
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Empty>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
let params = (paramsOrCallback ||
{}) as Params$Resource$Locations$Transferlocation;
let options = (optionsOrCallback || {}) as MethodOptions;

if (typeof paramsOrCallback === 'function') {
callback = paramsOrCallback;
params = {} as Params$Resource$Locations$Transferlocation;
options = {};
}

if (typeof optionsOrCallback === 'function') {
callback = optionsOrCallback;
options = {};
}

const rootUrl =
options.rootUrl ||
'https://mybusinessaccountmanagement.googleapis.com/';
const parameters = {
options: Object.assign(
{
url: (
rootUrl + '/v1/locations/{locationsId}:transferLocation'
).replace(/([^:]\/)\/+/g, '$1'),
method: 'POST',
},
options
),
params,
requiredParams: ['locationsId'],
pathParams: ['locationsId'],
context: this.context,
};
if (callback) {
createAPIRequest<Schema$Empty>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Empty>(parameters);
}
}
}

export interface Params$Resource$Locations$Transferlocation
extends StandardParameters {
/**
*
*/
locationsId?: string;

/**
* Request body metadata
*/
requestBody?: Schema$TransferLocationRequest;
}

export class Resource$Locations$Admins {
Expand Down

0 comments on commit b48400f

Please sign in to comment.