Class AccountsServiceClient
AccountsService client wrapper, for convenient use.
Namespace: Google.Shopping.Merchant.Accounts.V1Beta
Assembly: Google.Shopping.Merchant.Accounts.V1Beta.dll
Syntax
public abstract class AccountsServiceClient
Remarks
Service to support Accounts API.
Properties
DefaultEndpoint
The default endpoint for the AccountsService service, which is a host of "merchantapi.googleapis.com" and a port of 443.
Declaration
public static string DefaultEndpoint { get; }
Property Value
| Type | Description |
|---|---|
| string |
DefaultScopes
The default AccountsService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Remarks
The default AccountsService scopes are:
- https://www.googleapis.com/auth/content
GrpcClient
The underlying gRPC AccountsService client
Declaration
public virtual AccountsService.AccountsServiceClient GrpcClient { get; }
Property Value
| Type | Description |
|---|---|
| AccountsService.AccountsServiceClient |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
| Type | Description |
|---|---|
| ServiceMetadata |
Methods
Create()
Synchronously creates a AccountsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AccountsServiceClientBuilder.
Declaration
public static AccountsServiceClient Create()
Returns
| Type | Description |
|---|---|
| AccountsServiceClient | The created AccountsServiceClient. |
CreateAndConfigureAccount(CreateAndConfigureAccountRequest, CallSettings)
Creates a standalone Merchant Center account with additional configuration. Adds the user that makes the request as an admin for the new account.
Declaration
public virtual Account CreateAndConfigureAccount(CreateAndConfigureAccountRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateAndConfigureAccountRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Account | The RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
CreateAndConfigureAccountRequest request = new CreateAndConfigureAccountRequest
{
Account = new Account(),
Users =
{
new CreateUserRequest(),
},
AcceptTermsOfService = new CreateAndConfigureAccountRequest.Types.AcceptTermsOfService(),
Service =
{
new CreateAndConfigureAccountRequest.Types.AddAccountService(),
},
};
// Make the request
Account response = accountsServiceClient.CreateAndConfigureAccount(request);
CreateAndConfigureAccountAsync(CreateAndConfigureAccountRequest, CallSettings)
Creates a standalone Merchant Center account with additional configuration. Adds the user that makes the request as an admin for the new account.
Declaration
public virtual Task<Account> CreateAndConfigureAccountAsync(CreateAndConfigureAccountRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateAndConfigureAccountRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAndConfigureAccountRequest request = new CreateAndConfigureAccountRequest
{
Account = new Account(),
Users =
{
new CreateUserRequest(),
},
AcceptTermsOfService = new CreateAndConfigureAccountRequest.Types.AcceptTermsOfService(),
Service =
{
new CreateAndConfigureAccountRequest.Types.AddAccountService(),
},
};
// Make the request
Account response = await accountsServiceClient.CreateAndConfigureAccountAsync(request);
CreateAndConfigureAccountAsync(CreateAndConfigureAccountRequest, CancellationToken)
Creates a standalone Merchant Center account with additional configuration. Adds the user that makes the request as an admin for the new account.
Declaration
public virtual Task<Account> CreateAndConfigureAccountAsync(CreateAndConfigureAccountRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CreateAndConfigureAccountRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAndConfigureAccountRequest request = new CreateAndConfigureAccountRequest
{
Account = new Account(),
Users =
{
new CreateUserRequest(),
},
AcceptTermsOfService = new CreateAndConfigureAccountRequest.Types.AcceptTermsOfService(),
Service =
{
new CreateAndConfigureAccountRequest.Types.AddAccountService(),
},
};
// Make the request
Account response = await accountsServiceClient.CreateAndConfigureAccountAsync(request);
CreateAsync(CancellationToken)
Asynchronously creates a AccountsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AccountsServiceClientBuilder.
Declaration
public static Task<AccountsServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
| Type | Description |
|---|---|
| Task<AccountsServiceClient> | The task representing the created AccountsServiceClient. |
DeleteAccount(AccountName, CallSettings)
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.
Declaration
public virtual void DeleteAccount(AccountName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | name | Required. The name of the account to delete.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
AccountName name = AccountName.FromAccount("[ACCOUNT]");
// Make the request
accountsServiceClient.DeleteAccount(name);
DeleteAccount(DeleteAccountRequest, CallSettings)
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.
Declaration
public virtual void DeleteAccount(DeleteAccountRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteAccountRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
DeleteAccountRequest request = new DeleteAccountRequest
{
AccountName = AccountName.FromAccount("[ACCOUNT]"),
Force = false,
};
// Make the request
accountsServiceClient.DeleteAccount(request);
DeleteAccount(string, CallSettings)
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.
Declaration
public virtual void DeleteAccount(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the account to delete.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]";
// Make the request
accountsServiceClient.DeleteAccount(name);
DeleteAccountAsync(AccountName, CallSettings)
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.
Declaration
public virtual Task DeleteAccountAsync(AccountName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | name | Required. The name of the account to delete.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName name = AccountName.FromAccount("[ACCOUNT]");
// Make the request
await accountsServiceClient.DeleteAccountAsync(name);
DeleteAccountAsync(AccountName, CancellationToken)
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.
Declaration
public virtual Task DeleteAccountAsync(AccountName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | name | Required. The name of the account to delete.
Format: |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName name = AccountName.FromAccount("[ACCOUNT]");
// Make the request
await accountsServiceClient.DeleteAccountAsync(name);
DeleteAccountAsync(DeleteAccountRequest, CallSettings)
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.
Declaration
public virtual Task DeleteAccountAsync(DeleteAccountRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteAccountRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAccountRequest request = new DeleteAccountRequest
{
AccountName = AccountName.FromAccount("[ACCOUNT]"),
Force = false,
};
// Make the request
await accountsServiceClient.DeleteAccountAsync(request);
DeleteAccountAsync(DeleteAccountRequest, CancellationToken)
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.
Declaration
public virtual Task DeleteAccountAsync(DeleteAccountRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| DeleteAccountRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAccountRequest request = new DeleteAccountRequest
{
AccountName = AccountName.FromAccount("[ACCOUNT]"),
Force = false,
};
// Make the request
await accountsServiceClient.DeleteAccountAsync(request);
DeleteAccountAsync(string, CallSettings)
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.
Declaration
public virtual Task DeleteAccountAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the account to delete.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]";
// Make the request
await accountsServiceClient.DeleteAccountAsync(name);
DeleteAccountAsync(string, CancellationToken)
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.
Declaration
public virtual Task DeleteAccountAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the account to delete.
Format: |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]";
// Make the request
await accountsServiceClient.DeleteAccountAsync(name);
GetAccount(AccountName, CallSettings)
Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.
Declaration
public virtual Account GetAccount(AccountName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | name | Required. The name of the account to retrieve.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Account | The RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
AccountName name = AccountName.FromAccount("[ACCOUNT]");
// Make the request
Account response = accountsServiceClient.GetAccount(name);
GetAccount(GetAccountRequest, CallSettings)
Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.
Declaration
public virtual Account GetAccount(GetAccountRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetAccountRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Account | The RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
GetAccountRequest request = new GetAccountRequest
{
AccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
Account response = accountsServiceClient.GetAccount(request);
GetAccount(string, CallSettings)
Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.
Declaration
public virtual Account GetAccount(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the account to retrieve.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Account | The RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]";
// Make the request
Account response = accountsServiceClient.GetAccount(name);
GetAccountAsync(AccountName, CallSettings)
Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.
Declaration
public virtual Task<Account> GetAccountAsync(AccountName name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | name | Required. The name of the account to retrieve.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName name = AccountName.FromAccount("[ACCOUNT]");
// Make the request
Account response = await accountsServiceClient.GetAccountAsync(name);
GetAccountAsync(AccountName, CancellationToken)
Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.
Declaration
public virtual Task<Account> GetAccountAsync(AccountName name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | name | Required. The name of the account to retrieve.
Format: |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName name = AccountName.FromAccount("[ACCOUNT]");
// Make the request
Account response = await accountsServiceClient.GetAccountAsync(name);
GetAccountAsync(GetAccountRequest, CallSettings)
Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.
Declaration
public virtual Task<Account> GetAccountAsync(GetAccountRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetAccountRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
GetAccountRequest request = new GetAccountRequest
{
AccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
Account response = await accountsServiceClient.GetAccountAsync(request);
GetAccountAsync(GetAccountRequest, CancellationToken)
Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.
Declaration
public virtual Task<Account> GetAccountAsync(GetAccountRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| GetAccountRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
GetAccountRequest request = new GetAccountRequest
{
AccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
Account response = await accountsServiceClient.GetAccountAsync(request);
GetAccountAsync(string, CallSettings)
Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.
Declaration
public virtual Task<Account> GetAccountAsync(string name, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the account to retrieve.
Format: |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]";
// Make the request
Account response = await accountsServiceClient.GetAccountAsync(name);
GetAccountAsync(string, CancellationToken)
Retrieves an account from your Merchant Center account. After inserting, updating, or deleting an account, it may take several minutes before changes take effect.
Declaration
public virtual Task<Account> GetAccountAsync(string name, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Required. The name of the account to retrieve.
Format: |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]";
// Make the request
Account response = await accountsServiceClient.GetAccountAsync(name);
ListAccounts(ListAccountsRequest, CallSettings)
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.
Declaration
public virtual PagedEnumerable<ListAccountsResponse, Account> ListAccounts(ListAccountsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListAccountsRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListAccountsResponse, Account> | A pageable sequence of Account resources. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
ListAccountsRequest request = new ListAccountsRequest { Filter = "", };
// Make the request
PagedEnumerable<ListAccountsResponse, Account> response = accountsServiceClient.ListAccounts(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Account item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAccountsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Account item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Account> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Account item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAccountsAsync(ListAccountsRequest, CallSettings)
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.
Declaration
public virtual PagedAsyncEnumerable<ListAccountsResponse, Account> ListAccountsAsync(ListAccountsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListAccountsRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListAccountsResponse, Account> | A pageable asynchronous sequence of Account resources. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
ListAccountsRequest request = new ListAccountsRequest { Filter = "", };
// Make the request
PagedAsyncEnumerable<ListAccountsResponse, Account> response = accountsServiceClient.ListAccountsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Account item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAccountsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Account item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Account> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Account item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListSubAccounts(AccountName, string, int?, CallSettings)
List all sub-accounts for a given multi client account. This is a
convenience wrapper for the more powerful ListAccounts method. This
method will produce the same results as calling ListsAccounts with the
following filter:
relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))
Declaration
public virtual PagedEnumerable<ListSubAccountsResponse, Account> ListSubAccounts(AccountName provider, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | provider | Required. The parent account.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListSubAccountsResponse, Account> | A pageable sequence of Account resources. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
AccountName provider = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedEnumerable<ListSubAccountsResponse, Account> response = accountsServiceClient.ListSubAccounts(provider);
// Iterate over all response items, lazily performing RPCs as required
foreach (Account item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSubAccountsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Account item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Account> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Account item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListSubAccounts(ListSubAccountsRequest, CallSettings)
List all sub-accounts for a given multi client account. This is a
convenience wrapper for the more powerful ListAccounts method. This
method will produce the same results as calling ListsAccounts with the
following filter:
relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))
Declaration
public virtual PagedEnumerable<ListSubAccountsResponse, Account> ListSubAccounts(ListSubAccountsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListSubAccountsRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListSubAccountsResponse, Account> | A pageable sequence of Account resources. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
ListSubAccountsRequest request = new ListSubAccountsRequest
{
ProviderAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedEnumerable<ListSubAccountsResponse, Account> response = accountsServiceClient.ListSubAccounts(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Account item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSubAccountsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Account item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Account> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Account item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListSubAccounts(string, string, int?, CallSettings)
List all sub-accounts for a given multi client account. This is a
convenience wrapper for the more powerful ListAccounts method. This
method will produce the same results as calling ListsAccounts with the
following filter:
relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))
Declaration
public virtual PagedEnumerable<ListSubAccountsResponse, Account> ListSubAccounts(string provider, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | provider | Required. The parent account.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedEnumerable<ListSubAccountsResponse, Account> | A pageable sequence of Account resources. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
string provider = "accounts/[ACCOUNT]";
// Make the request
PagedEnumerable<ListSubAccountsResponse, Account> response = accountsServiceClient.ListSubAccounts(provider);
// Iterate over all response items, lazily performing RPCs as required
foreach (Account item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSubAccountsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Account item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Account> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Account item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListSubAccountsAsync(AccountName, string, int?, CallSettings)
List all sub-accounts for a given multi client account. This is a
convenience wrapper for the more powerful ListAccounts method. This
method will produce the same results as calling ListsAccounts with the
following filter:
relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))
Declaration
public virtual PagedAsyncEnumerable<ListSubAccountsResponse, Account> ListSubAccountsAsync(AccountName provider, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AccountName | provider | Required. The parent account.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListSubAccountsResponse, Account> | A pageable asynchronous sequence of Account resources. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName provider = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedAsyncEnumerable<ListSubAccountsResponse, Account> response = accountsServiceClient.ListSubAccountsAsync(provider);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Account item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSubAccountsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Account item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Account> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Account item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListSubAccountsAsync(ListSubAccountsRequest, CallSettings)
List all sub-accounts for a given multi client account. This is a
convenience wrapper for the more powerful ListAccounts method. This
method will produce the same results as calling ListsAccounts with the
following filter:
relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))
Declaration
public virtual PagedAsyncEnumerable<ListSubAccountsResponse, Account> ListSubAccountsAsync(ListSubAccountsRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ListSubAccountsRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListSubAccountsResponse, Account> | A pageable asynchronous sequence of Account resources. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
ListSubAccountsRequest request = new ListSubAccountsRequest
{
ProviderAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedAsyncEnumerable<ListSubAccountsResponse, Account> response = accountsServiceClient.ListSubAccountsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Account item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSubAccountsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Account item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Account> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Account item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListSubAccountsAsync(string, string, int?, CallSettings)
List all sub-accounts for a given multi client account. This is a
convenience wrapper for the more powerful ListAccounts method. This
method will produce the same results as calling ListsAccounts with the
following filter:
relationship(providerId={parent} AND service(type="ACCOUNT_AGGREGATION"))
Declaration
public virtual PagedAsyncEnumerable<ListSubAccountsResponse, Account> ListSubAccountsAsync(string provider, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | provider | Required. The parent account.
Format: |
| string | pageToken | The token returned from the previous request. A value of |
| int? | pageSize | The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| PagedAsyncEnumerable<ListSubAccountsResponse, Account> | A pageable asynchronous sequence of Account resources. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
string provider = "accounts/[ACCOUNT]";
// Make the request
PagedAsyncEnumerable<ListSubAccountsResponse, Account> response = accountsServiceClient.ListSubAccountsAsync(provider);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Account item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSubAccountsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Account item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Account> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Account item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Declaration
public static Task ShutdownDefaultChannelsAsync()
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous shutdown operation. |
Remarks
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.
UpdateAccount(Account, FieldMask, CallSettings)
Updates an account regardless of its type: standalone, MCA or sub-account. Executing this method requires admin access.
Declaration
public virtual Account UpdateAccount(Account account, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Account | account | Required. The new version of the account. |
| FieldMask | updateMask | Required. List of fields being updated. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Account | The RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
Account account = new Account();
FieldMask updateMask = new FieldMask();
// Make the request
Account response = accountsServiceClient.UpdateAccount(account, updateMask);
UpdateAccount(UpdateAccountRequest, CallSettings)
Updates an account regardless of its type: standalone, MCA or sub-account. Executing this method requires admin access.
Declaration
public virtual Account UpdateAccount(UpdateAccountRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateAccountRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Account | The RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = AccountsServiceClient.Create();
// Initialize request argument(s)
UpdateAccountRequest request = new UpdateAccountRequest
{
Account = new Account(),
UpdateMask = new FieldMask(),
};
// Make the request
Account response = accountsServiceClient.UpdateAccount(request);
UpdateAccountAsync(Account, FieldMask, CallSettings)
Updates an account regardless of its type: standalone, MCA or sub-account. Executing this method requires admin access.
Declaration
public virtual Task<Account> UpdateAccountAsync(Account account, FieldMask updateMask, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Account | account | Required. The new version of the account. |
| FieldMask | updateMask | Required. List of fields being updated. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
Account account = new Account();
FieldMask updateMask = new FieldMask();
// Make the request
Account response = await accountsServiceClient.UpdateAccountAsync(account, updateMask);
UpdateAccountAsync(Account, FieldMask, CancellationToken)
Updates an account regardless of its type: standalone, MCA or sub-account. Executing this method requires admin access.
Declaration
public virtual Task<Account> UpdateAccountAsync(Account account, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| Account | account | Required. The new version of the account. |
| FieldMask | updateMask | Required. List of fields being updated. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
Account account = new Account();
FieldMask updateMask = new FieldMask();
// Make the request
Account response = await accountsServiceClient.UpdateAccountAsync(account, updateMask);
UpdateAccountAsync(UpdateAccountRequest, CallSettings)
Updates an account regardless of its type: standalone, MCA or sub-account. Executing this method requires admin access.
Declaration
public virtual Task<Account> UpdateAccountAsync(UpdateAccountRequest request, CallSettings callSettings = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateAccountRequest | request | The request object containing all of the parameters for the API call. |
| CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAccountRequest request = new UpdateAccountRequest
{
Account = new Account(),
UpdateMask = new FieldMask(),
};
// Make the request
Account response = await accountsServiceClient.UpdateAccountAsync(request);
UpdateAccountAsync(UpdateAccountRequest, CancellationToken)
Updates an account regardless of its type: standalone, MCA or sub-account. Executing this method requires admin access.
Declaration
public virtual Task<Account> UpdateAccountAsync(UpdateAccountRequest request, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateAccountRequest | request | The request object containing all of the parameters for the API call. |
| CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
| Type | Description |
|---|---|
| Task<Account> | A Task containing the RPC response. |
Sample code
// Create client
AccountsServiceClient accountsServiceClient = await AccountsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAccountRequest request = new UpdateAccountRequest
{
Account = new Account(),
UpdateMask = new FieldMask(),
};
// Make the request
Account response = await accountsServiceClient.UpdateAccountAsync(request);