Skip to content

Commit

Permalink
feat: [merchantapi] add 'force' parameter for accounts.delete method (#…
Browse files Browse the repository at this point in the history
…5720)

* feat: add 'force' parameter for accounts.delete method
docs: updated descriptions for the DeleteAccount and ListAccounts RPCs

PiperOrigin-RevId: 680468173

Source-Link: googleapis/googleapis@1b2f804

Source-Link: googleapis/googleapis-gen@aaf00b0
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXNob3BwaW5nLW1lcmNoYW50LWFjY291bnRzLy5Pd2xCb3QueWFtbCIsImgiOiJhYWYwMGIwNzBlMDAwMzc0ZTBmNTMxMzE5ZTRiN2RkNzk3ZGUzMTY1In0=

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Oct 8, 2024
1 parent 3eb6375 commit e3ff2cc
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ service AccountsService {
// Deletes the specified account regardless of its type: standalone, MCA or
// sub-account. Deleting an MCA leads to the deletion of all of its
// sub-accounts. Executing this method requires admin access.
// The deletion succeeds only if the account does not provide services
// to any other account and has no processed offers. You can use the `force`
// parameter to override this.
rpc DeleteAccount(DeleteAccountRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/accounts/v1beta/{name=accounts/*}"
Expand All @@ -80,7 +83,8 @@ service AccountsService {
// constraints of the request such as page size or filters.
// This is not just listing the sub-accounts of an MCA, but all accounts the
// calling user has access to including other MCAs, linked accounts,
// standalone accounts and so on.
// standalone accounts and so on. If no filter is provided, then it returns
// accounts the user is directly added to.
rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) {
option (google.api.http) = {
get: "/accounts/v1beta/accounts"
Expand Down Expand Up @@ -226,6 +230,10 @@ message DeleteAccountRequest {
type: "merchantapi.googleapis.com/Account"
}
];

// Optional. If set to `true`, the account is deleted even if it provides
// services to other accounts or has processed offers.
bool force = 2 [(google.api.field_behavior) = OPTIONAL];
}

// Request message for the `UpdateAccount` method.
Expand Down
6 changes: 6 additions & 0 deletions packages/google-shopping-merchant-accounts/protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 25 additions & 1 deletion packages/google-shopping-merchant-accounts/protos/protos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/google-shopping-merchant-accounts/protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ function main(name) {
* Format: `accounts/{account}`
*/
// const name = 'abc123'
/**
* Optional. If set to `true`, the account is deleted even if it provides
* services to other accounts or has processed offers.
*/
// const force = true

// Imports the Accounts library
const {AccountsServiceClient} = require('@google-shopping/accounts').v1beta;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@
"regionTag": "merchantapi_v1beta_generated_AccountsService_DeleteAccount_async",
"title": "AccountIssueService deleteAccount Sample",
"origin": "API_DEFINITION",
"description": " Deletes the specified account regardless of its type: standalone, MCA or sub-account. Deleting an MCA leads to the deletion of all of its sub-accounts. Executing this method requires admin access.",
"description": " Deletes the specified account regardless of its type: standalone, MCA or sub-account. Deleting an MCA leads to the deletion of all of its sub-accounts. Executing this method requires admin access. The deletion succeeds only if the account does not provide services to any other account and has no processed offers. You can use the `force` parameter to override this.",
"canonical": true,
"file": "accounts_service.delete_account.js",
"language": "JAVASCRIPT",
"segments": [
{
"start": 25,
"end": 54,
"end": 59,
"type": "FULL"
}
],
Expand All @@ -182,6 +182,10 @@
{
"name": "name",
"type": "TYPE_STRING"
},
{
"name": "force",
"type": "TYPE_BOOL"
}
],
"resultType": ".google.protobuf.Empty",
Expand Down Expand Up @@ -247,7 +251,7 @@
"regionTag": "merchantapi_v1beta_generated_AccountsService_ListAccounts_async",
"title": "AccountIssueService listAccounts Sample",
"origin": "API_DEFINITION",
"description": " Lists accounts accessible to the calling user and matching the constraints of the request such as page size or filters. This is not just listing the sub-accounts of an MCA, but all accounts the calling user has access to including other MCAs, linked accounts, standalone accounts and so on.",
"description": " Lists accounts accessible to the calling user and matching the constraints of the request such as page size or filters. This is not just listing the sub-accounts of an MCA, but all accounts the calling user has access to including other MCAs, linked accounts, standalone accounts and so on. If no filter is provided, then it returns accounts the user is directly added to.",
"canonical": true,
"file": "accounts_service.list_accounts.js",
"language": "JAVASCRIPT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,12 +646,18 @@ export class AccountsServiceClient {
* Deletes the specified account regardless of its type: standalone, MCA or
* sub-account. Deleting an MCA leads to the deletion of all of its
* sub-accounts. Executing this method requires admin access.
* The deletion succeeds only if the account does not provide services
* to any other account and has no processed offers. You can use the `force`
* parameter to override this.
*
* @param {Object} request
* The request object that will be sent.
* @param {string} request.name
* Required. The name of the account to delete.
* Format: `accounts/{account}`
* @param {boolean} [request.force]
* Optional. If set to `true`, the account is deleted even if it provides
* services to other accounts or has processed offers.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
Expand Down Expand Up @@ -846,7 +852,8 @@ export class AccountsServiceClient {
* constraints of the request such as page size or filters.
* This is not just listing the sub-accounts of an MCA, but all accounts the
* calling user has access to including other MCAs, linked accounts,
* standalone accounts and so on.
* standalone accounts and so on. If no filter is provided, then it returns
* accounts the user is directly added to.
*
* @param {Object} request
* The request object that will be sent.
Expand Down

0 comments on commit e3ff2cc

Please sign in to comment.