Class AccountLabelsServiceClient
AccountLabelsService client wrapper, for convenient use.
Namespace: Google.Shopping.Css.V1
Assembly: Google.Shopping.Css.V1.dll
Syntax
public abstract class AccountLabelsServiceClient
Remarks
Manages Merchant Center and CSS accounts labels.
Properties
DefaultEndpoint
The default endpoint for the AccountLabelsService service, which is a host of "css.googleapis.com" and a port of 443.
Declaration
public static string DefaultEndpoint { get; }
Property Value
Type | Description |
---|---|
string |
DefaultScopes
The default AccountLabelsService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<string> |
Remarks
The default AccountLabelsService scopes are:
- https://www.googleapis.com/auth/content
GrpcClient
The underlying gRPC AccountLabelsService client
Declaration
public virtual AccountLabelsService.AccountLabelsServiceClient GrpcClient { get; }
Property Value
Type | Description |
---|---|
AccountLabelsService.AccountLabelsServiceClient |
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 AccountLabelsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AccountLabelsServiceClientBuilder.
Declaration
public static AccountLabelsServiceClient Create()
Returns
Type | Description |
---|---|
AccountLabelsServiceClient | The created AccountLabelsServiceClient. |
CreateAccountLabel(AccountName, AccountLabel, CallSettings)
Creates a new label, not assigned to any account.
Declaration
public virtual AccountLabel CreateAccountLabel(AccountName parent, AccountLabel accountLabel, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountName | parent | Required. The parent account. Format: accounts/{account} |
AccountLabel | accountLabel | Required. The label to create. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
AccountLabel | The RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = AccountLabelsServiceClient.Create();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
AccountLabel accountLabel = new AccountLabel();
// Make the request
AccountLabel response = accountLabelsServiceClient.CreateAccountLabel(parent, accountLabel);
CreateAccountLabel(CreateAccountLabelRequest, CallSettings)
Creates a new label, not assigned to any account.
Declaration
public virtual AccountLabel CreateAccountLabel(CreateAccountLabelRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CreateAccountLabelRequest | 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 |
---|---|
AccountLabel | The RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = AccountLabelsServiceClient.Create();
// Initialize request argument(s)
CreateAccountLabelRequest request = new CreateAccountLabelRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
AccountLabel = new AccountLabel(),
};
// Make the request
AccountLabel response = accountLabelsServiceClient.CreateAccountLabel(request);
CreateAccountLabel(string, AccountLabel, CallSettings)
Creates a new label, not assigned to any account.
Declaration
public virtual AccountLabel CreateAccountLabel(string parent, AccountLabel accountLabel, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The parent account. Format: accounts/{account} |
AccountLabel | accountLabel | Required. The label to create. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
AccountLabel | The RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = AccountLabelsServiceClient.Create();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
AccountLabel accountLabel = new AccountLabel();
// Make the request
AccountLabel response = accountLabelsServiceClient.CreateAccountLabel(parent, accountLabel);
CreateAccountLabelAsync(AccountName, AccountLabel, CallSettings)
Creates a new label, not assigned to any account.
Declaration
public virtual Task<AccountLabel> CreateAccountLabelAsync(AccountName parent, AccountLabel accountLabel, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountName | parent | Required. The parent account. Format: accounts/{account} |
AccountLabel | accountLabel | Required. The label to create. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<AccountLabel> | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
AccountLabel accountLabel = new AccountLabel();
// Make the request
AccountLabel response = await accountLabelsServiceClient.CreateAccountLabelAsync(parent, accountLabel);
CreateAccountLabelAsync(AccountName, AccountLabel, CancellationToken)
Creates a new label, not assigned to any account.
Declaration
public virtual Task<AccountLabel> CreateAccountLabelAsync(AccountName parent, AccountLabel accountLabel, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
AccountName | parent | Required. The parent account. Format: accounts/{account} |
AccountLabel | accountLabel | Required. The label to create. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<AccountLabel> | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
AccountLabel accountLabel = new AccountLabel();
// Make the request
AccountLabel response = await accountLabelsServiceClient.CreateAccountLabelAsync(parent, accountLabel);
CreateAccountLabelAsync(CreateAccountLabelRequest, CallSettings)
Creates a new label, not assigned to any account.
Declaration
public virtual Task<AccountLabel> CreateAccountLabelAsync(CreateAccountLabelRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CreateAccountLabelRequest | 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<AccountLabel> | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAccountLabelRequest request = new CreateAccountLabelRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
AccountLabel = new AccountLabel(),
};
// Make the request
AccountLabel response = await accountLabelsServiceClient.CreateAccountLabelAsync(request);
CreateAccountLabelAsync(CreateAccountLabelRequest, CancellationToken)
Creates a new label, not assigned to any account.
Declaration
public virtual Task<AccountLabel> CreateAccountLabelAsync(CreateAccountLabelRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CreateAccountLabelRequest | 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<AccountLabel> | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAccountLabelRequest request = new CreateAccountLabelRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
AccountLabel = new AccountLabel(),
};
// Make the request
AccountLabel response = await accountLabelsServiceClient.CreateAccountLabelAsync(request);
CreateAccountLabelAsync(string, AccountLabel, CallSettings)
Creates a new label, not assigned to any account.
Declaration
public virtual Task<AccountLabel> CreateAccountLabelAsync(string parent, AccountLabel accountLabel, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The parent account. Format: accounts/{account} |
AccountLabel | accountLabel | Required. The label to create. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<AccountLabel> | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
AccountLabel accountLabel = new AccountLabel();
// Make the request
AccountLabel response = await accountLabelsServiceClient.CreateAccountLabelAsync(parent, accountLabel);
CreateAccountLabelAsync(string, AccountLabel, CancellationToken)
Creates a new label, not assigned to any account.
Declaration
public virtual Task<AccountLabel> CreateAccountLabelAsync(string parent, AccountLabel accountLabel, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The parent account. Format: accounts/{account} |
AccountLabel | accountLabel | Required. The label to create. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<AccountLabel> | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
AccountLabel accountLabel = new AccountLabel();
// Make the request
AccountLabel response = await accountLabelsServiceClient.CreateAccountLabelAsync(parent, accountLabel);
CreateAsync(CancellationToken)
Asynchronously creates a AccountLabelsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AccountLabelsServiceClientBuilder.
Declaration
public static Task<AccountLabelsServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
Type | Description |
---|---|
Task<AccountLabelsServiceClient> | The task representing the created AccountLabelsServiceClient. |
DeleteAccountLabel(AccountLabelName, CallSettings)
Deletes a label and removes it from all accounts to which it was assigned.
Declaration
public virtual void DeleteAccountLabel(AccountLabelName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountLabelName | name | Required. The name of the label to delete. Format: accounts/{account}/labels/{label} |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = AccountLabelsServiceClient.Create();
// Initialize request argument(s)
AccountLabelName name = AccountLabelName.FromAccountLabel("[ACCOUNT]", "[LABEL]");
// Make the request
accountLabelsServiceClient.DeleteAccountLabel(name);
DeleteAccountLabel(DeleteAccountLabelRequest, CallSettings)
Deletes a label and removes it from all accounts to which it was assigned.
Declaration
public virtual void DeleteAccountLabel(DeleteAccountLabelRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
DeleteAccountLabelRequest | 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
AccountLabelsServiceClient accountLabelsServiceClient = AccountLabelsServiceClient.Create();
// Initialize request argument(s)
DeleteAccountLabelRequest request = new DeleteAccountLabelRequest
{
AccountLabelName = AccountLabelName.FromAccountLabel("[ACCOUNT]", "[LABEL]"),
};
// Make the request
accountLabelsServiceClient.DeleteAccountLabel(request);
DeleteAccountLabel(string, CallSettings)
Deletes a label and removes it from all accounts to which it was assigned.
Declaration
public virtual void DeleteAccountLabel(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the label to delete. Format: accounts/{account}/labels/{label} |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = AccountLabelsServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/labels/[LABEL]";
// Make the request
accountLabelsServiceClient.DeleteAccountLabel(name);
DeleteAccountLabelAsync(AccountLabelName, CallSettings)
Deletes a label and removes it from all accounts to which it was assigned.
Declaration
public virtual Task DeleteAccountLabelAsync(AccountLabelName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountLabelName | name | Required. The name of the label to delete. Format: accounts/{account}/labels/{label} |
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
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountLabelName name = AccountLabelName.FromAccountLabel("[ACCOUNT]", "[LABEL]");
// Make the request
await accountLabelsServiceClient.DeleteAccountLabelAsync(name);
DeleteAccountLabelAsync(AccountLabelName, CancellationToken)
Deletes a label and removes it from all accounts to which it was assigned.
Declaration
public virtual Task DeleteAccountLabelAsync(AccountLabelName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
AccountLabelName | name | Required. The name of the label to delete. Format: accounts/{account}/labels/{label} |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountLabelName name = AccountLabelName.FromAccountLabel("[ACCOUNT]", "[LABEL]");
// Make the request
await accountLabelsServiceClient.DeleteAccountLabelAsync(name);
DeleteAccountLabelAsync(DeleteAccountLabelRequest, CallSettings)
Deletes a label and removes it from all accounts to which it was assigned.
Declaration
public virtual Task DeleteAccountLabelAsync(DeleteAccountLabelRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
DeleteAccountLabelRequest | 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
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAccountLabelRequest request = new DeleteAccountLabelRequest
{
AccountLabelName = AccountLabelName.FromAccountLabel("[ACCOUNT]", "[LABEL]"),
};
// Make the request
await accountLabelsServiceClient.DeleteAccountLabelAsync(request);
DeleteAccountLabelAsync(DeleteAccountLabelRequest, CancellationToken)
Deletes a label and removes it from all accounts to which it was assigned.
Declaration
public virtual Task DeleteAccountLabelAsync(DeleteAccountLabelRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
DeleteAccountLabelRequest | 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
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAccountLabelRequest request = new DeleteAccountLabelRequest
{
AccountLabelName = AccountLabelName.FromAccountLabel("[ACCOUNT]", "[LABEL]"),
};
// Make the request
await accountLabelsServiceClient.DeleteAccountLabelAsync(request);
DeleteAccountLabelAsync(string, CallSettings)
Deletes a label and removes it from all accounts to which it was assigned.
Declaration
public virtual Task DeleteAccountLabelAsync(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the label to delete. Format: accounts/{account}/labels/{label} |
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
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/labels/[LABEL]";
// Make the request
await accountLabelsServiceClient.DeleteAccountLabelAsync(name);
DeleteAccountLabelAsync(string, CancellationToken)
Deletes a label and removes it from all accounts to which it was assigned.
Declaration
public virtual Task DeleteAccountLabelAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the label to delete. Format: accounts/{account}/labels/{label} |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/labels/[LABEL]";
// Make the request
await accountLabelsServiceClient.DeleteAccountLabelAsync(name);
ListAccountLabels(AccountName, string, int?, CallSettings)
Lists the labels assigned to an account.
Declaration
public virtual PagedEnumerable<ListAccountLabelsResponse, AccountLabel> ListAccountLabels(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountName | parent | Required. The parent account. Format: accounts/{account} |
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<ListAccountLabelsResponse, AccountLabel> | A pageable sequence of AccountLabel resources. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = AccountLabelsServiceClient.Create();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedEnumerable<ListAccountLabelsResponse, AccountLabel> response = accountLabelsServiceClient.ListAccountLabels(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AccountLabel 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 (ListAccountLabelsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AccountLabel 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<AccountLabel> 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 (AccountLabel 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;
ListAccountLabels(ListAccountLabelsRequest, CallSettings)
Lists the labels assigned to an account.
Declaration
public virtual PagedEnumerable<ListAccountLabelsResponse, AccountLabel> ListAccountLabels(ListAccountLabelsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ListAccountLabelsRequest | 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<ListAccountLabelsResponse, AccountLabel> | A pageable sequence of AccountLabel resources. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = AccountLabelsServiceClient.Create();
// Initialize request argument(s)
ListAccountLabelsRequest request = new ListAccountLabelsRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedEnumerable<ListAccountLabelsResponse, AccountLabel> response = accountLabelsServiceClient.ListAccountLabels(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (AccountLabel 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 (ListAccountLabelsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AccountLabel 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<AccountLabel> 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 (AccountLabel 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;
ListAccountLabels(string, string, int?, CallSettings)
Lists the labels assigned to an account.
Declaration
public virtual PagedEnumerable<ListAccountLabelsResponse, AccountLabel> ListAccountLabels(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The parent account. Format: accounts/{account} |
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<ListAccountLabelsResponse, AccountLabel> | A pageable sequence of AccountLabel resources. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = AccountLabelsServiceClient.Create();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedEnumerable<ListAccountLabelsResponse, AccountLabel> response = accountLabelsServiceClient.ListAccountLabels(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AccountLabel 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 (ListAccountLabelsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AccountLabel 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<AccountLabel> 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 (AccountLabel 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;
ListAccountLabelsAsync(AccountName, string, int?, CallSettings)
Lists the labels assigned to an account.
Declaration
public virtual PagedAsyncEnumerable<ListAccountLabelsResponse, AccountLabel> ListAccountLabelsAsync(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountName | parent | Required. The parent account. Format: accounts/{account} |
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<ListAccountLabelsResponse, AccountLabel> | A pageable asynchronous sequence of AccountLabel resources. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedAsyncEnumerable<ListAccountLabelsResponse, AccountLabel> response = accountLabelsServiceClient.ListAccountLabelsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AccountLabel 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((ListAccountLabelsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AccountLabel 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<AccountLabel> 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 (AccountLabel 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;
ListAccountLabelsAsync(ListAccountLabelsRequest, CallSettings)
Lists the labels assigned to an account.
Declaration
public virtual PagedAsyncEnumerable<ListAccountLabelsResponse, AccountLabel> ListAccountLabelsAsync(ListAccountLabelsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ListAccountLabelsRequest | 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<ListAccountLabelsResponse, AccountLabel> | A pageable asynchronous sequence of AccountLabel resources. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
ListAccountLabelsRequest request = new ListAccountLabelsRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedAsyncEnumerable<ListAccountLabelsResponse, AccountLabel> response = accountLabelsServiceClient.ListAccountLabelsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AccountLabel 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((ListAccountLabelsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AccountLabel 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<AccountLabel> 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 (AccountLabel 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;
ListAccountLabelsAsync(string, string, int?, CallSettings)
Lists the labels assigned to an account.
Declaration
public virtual PagedAsyncEnumerable<ListAccountLabelsResponse, AccountLabel> ListAccountLabelsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The parent account. Format: accounts/{account} |
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<ListAccountLabelsResponse, AccountLabel> | A pageable asynchronous sequence of AccountLabel resources. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedAsyncEnumerable<ListAccountLabelsResponse, AccountLabel> response = accountLabelsServiceClient.ListAccountLabelsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AccountLabel 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((ListAccountLabelsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AccountLabel 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<AccountLabel> 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 (AccountLabel 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.
UpdateAccountLabel(AccountLabel, CallSettings)
Updates a label.
Declaration
public virtual AccountLabel UpdateAccountLabel(AccountLabel accountLabel, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountLabel | accountLabel | Required. The updated label. All fields must be provided. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
AccountLabel | The RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = AccountLabelsServiceClient.Create();
// Initialize request argument(s)
AccountLabel accountLabel = new AccountLabel();
// Make the request
AccountLabel response = accountLabelsServiceClient.UpdateAccountLabel(accountLabel);
UpdateAccountLabel(UpdateAccountLabelRequest, CallSettings)
Updates a label.
Declaration
public virtual AccountLabel UpdateAccountLabel(UpdateAccountLabelRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
UpdateAccountLabelRequest | 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 |
---|---|
AccountLabel | The RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = AccountLabelsServiceClient.Create();
// Initialize request argument(s)
UpdateAccountLabelRequest request = new UpdateAccountLabelRequest
{
AccountLabel = new AccountLabel(),
};
// Make the request
AccountLabel response = accountLabelsServiceClient.UpdateAccountLabel(request);
UpdateAccountLabelAsync(AccountLabel, CallSettings)
Updates a label.
Declaration
public virtual Task<AccountLabel> UpdateAccountLabelAsync(AccountLabel accountLabel, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountLabel | accountLabel | Required. The updated label. All fields must be provided. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<AccountLabel> | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountLabel accountLabel = new AccountLabel();
// Make the request
AccountLabel response = await accountLabelsServiceClient.UpdateAccountLabelAsync(accountLabel);
UpdateAccountLabelAsync(AccountLabel, CancellationToken)
Updates a label.
Declaration
public virtual Task<AccountLabel> UpdateAccountLabelAsync(AccountLabel accountLabel, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
AccountLabel | accountLabel | Required. The updated label. All fields must be provided. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<AccountLabel> | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountLabel accountLabel = new AccountLabel();
// Make the request
AccountLabel response = await accountLabelsServiceClient.UpdateAccountLabelAsync(accountLabel);
UpdateAccountLabelAsync(UpdateAccountLabelRequest, CallSettings)
Updates a label.
Declaration
public virtual Task<AccountLabel> UpdateAccountLabelAsync(UpdateAccountLabelRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
UpdateAccountLabelRequest | 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<AccountLabel> | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAccountLabelRequest request = new UpdateAccountLabelRequest
{
AccountLabel = new AccountLabel(),
};
// Make the request
AccountLabel response = await accountLabelsServiceClient.UpdateAccountLabelAsync(request);
UpdateAccountLabelAsync(UpdateAccountLabelRequest, CancellationToken)
Updates a label.
Declaration
public virtual Task<AccountLabel> UpdateAccountLabelAsync(UpdateAccountLabelRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
UpdateAccountLabelRequest | 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<AccountLabel> | A Task containing the RPC response. |
Sample code
// Create client
AccountLabelsServiceClient accountLabelsServiceClient = await AccountLabelsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAccountLabelRequest request = new UpdateAccountLabelRequest
{
AccountLabel = new AccountLabel(),
};
// Make the request
AccountLabel response = await accountLabelsServiceClient.UpdateAccountLabelAsync(request);