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 |
---|---|
IRead |
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 |
---|---|
Account |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
Type | Description |
---|---|
Service |
Methods
Create()
Synchronously creates a Account
Declaration
public static AccountLabelsServiceClient Create()
Returns
Type | Description |
---|---|
Account |
The created Account |
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 |
---|---|---|
Account |
parent | Required. The parent account. Format: accounts/{account} |
Account |
accountLabel | Required. The label to create. |
Call |
callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Account |
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 |
---|---|---|
Create |
request | The request object containing all of the parameters for the API call. |
Call |
callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Account |
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} |
Account |
accountLabel | Required. The label to create. |
Call |
callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Account |
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 |
---|---|---|
Account |
parent | Required. The parent account. Format: accounts/{account} |
Account |
accountLabel | Required. The label to create. |
Call |
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
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 |
---|---|---|
Account |
parent | Required. The parent account. Format: accounts/{account} |
Account |
accountLabel | Required. The label to create. |
Cancellation |
cancellationToken | A Cancellation |
Returns
Type | Description |
---|---|
Task<Account |
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 |
---|---|---|
Create |
request | The request object containing all of the parameters for the API call. |
Call |
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
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 |
---|---|---|
Create |
request | The request object containing all of the parameters for the API call. |
Cancellation |
cancellationToken | A Cancellation |
Returns
Type | Description |
---|---|
Task<Account |
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} |
Account |
accountLabel | Required. The label to create. |
Call |
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
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} |
Account |
accountLabel | Required. The label to create. |
Cancellation |
cancellationToken | A Cancellation |
Returns
Type | Description |
---|---|
Task<Account |
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 Account
Declaration
public static Task<AccountLabelsServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Cancellation |
cancellationToken | The Cancellation |
Returns
Type | Description |
---|---|
Task<Account |
The task representing the created Account |
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 |
---|---|---|
Account |
name | Required. The name of the label to delete. Format: accounts/{account}/labels/{label} |
Call |
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 |
---|---|---|
Delete |
request | The request object containing all of the parameters for the API call. |
Call |
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} |
Call |
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 |
---|---|---|
Account |
name | Required. The name of the label to delete. Format: accounts/{account}/labels/{label} |
Call |
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 |
---|---|---|
Account |
name | Required. The name of the label to delete. Format: accounts/{account}/labels/{label} |
Cancellation |
cancellationToken | A Cancellation |
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 |
---|---|---|
Delete |
request | The request object containing all of the parameters for the API call. |
Call |
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 |
---|---|---|
Delete |
request | The request object containing all of the parameters for the API call. |
Cancellation |
cancellationToken | A Cancellation |
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} |
Call |
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} |
Cancellation |
cancellationToken | A Cancellation |
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 owned by an account.
Declaration
public virtual PagedEnumerable<ListAccountLabelsResponse, AccountLabel> ListAccountLabels(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
Account |
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
|
Call |
callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Paged |
A pageable sequence of Account |
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 owned by an account.
Declaration
public virtual PagedEnumerable<ListAccountLabelsResponse, AccountLabel> ListAccountLabels(ListAccountLabelsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
List |
request | The request object containing all of the parameters for the API call. |
Call |
callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Paged |
A pageable sequence of Account |
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 owned by 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
|
Call |
callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Paged |
A pageable sequence of Account |
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 owned by an account.
Declaration
public virtual PagedAsyncEnumerable<ListAccountLabelsResponse, AccountLabel> ListAccountLabelsAsync(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
Account |
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
|
Call |
callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Paged |
A pageable asynchronous sequence of Account |
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 owned by an account.
Declaration
public virtual PagedAsyncEnumerable<ListAccountLabelsResponse, AccountLabel> ListAccountLabelsAsync(ListAccountLabelsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
List |
request | The request object containing all of the parameters for the API call. |
Call |
callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Paged |
A pageable asynchronous sequence of Account |
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 owned by 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
|
Call |
callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Paged |
A pageable asynchronous sequence of Account |
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
Create
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
Create
UpdateAccountLabel(AccountLabel, CallSettings)
Updates a label.
Declaration
public virtual AccountLabel UpdateAccountLabel(AccountLabel accountLabel, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
Account |
accountLabel | Required. The updated label. All fields must be provided. |
Call |
callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Account |
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 |
---|---|---|
Update |
request | The request object containing all of the parameters for the API call. |
Call |
callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Account |
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 |
---|---|---|
Account |
accountLabel | Required. The updated label. All fields must be provided. |
Call |
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
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 |
---|---|---|
Account |
accountLabel | Required. The updated label. All fields must be provided. |
Cancellation |
cancellationToken | A Cancellation |
Returns
Type | Description |
---|---|
Task<Account |
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 |
---|---|---|
Update |
request | The request object containing all of the parameters for the API call. |
Call |
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
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 |
---|---|---|
Update |
request | The request object containing all of the parameters for the API call. |
Cancellation |
cancellationToken | A Cancellation |
Returns
Type | Description |
---|---|
Task<Account |
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);