Class RegionsServiceClient
RegionsService client wrapper, for convenient use.
Namespace: Google.Shopping.Merchant.Accounts.V1Beta
Assembly: Google.Shopping.Merchant.Accounts.V1Beta.dll
Syntax
public abstract class RegionsServiceClient
Remarks
Manages regions configuration.
This API defines the following resource model:
- [Region][google.shopping.merchant.accounts.v1main.Region]
Properties
DefaultEndpoint
The default endpoint for the RegionsService 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 RegionsService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<string> |
Remarks
The default RegionsService scopes are:
- https://www.googleapis.com/auth/content
GrpcClient
The underlying gRPC RegionsService client
Declaration
public virtual RegionsService.RegionsServiceClient GrpcClient { get; }
Property Value
Type | Description |
---|---|
RegionsService.RegionsServiceClient |
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 RegionsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use RegionsServiceClientBuilder.
Declaration
public static RegionsServiceClient Create()
Returns
Type | Description |
---|---|
RegionsServiceClient | The created RegionsServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a RegionsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use RegionsServiceClientBuilder.
Declaration
public static Task<RegionsServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
Type | Description |
---|---|
Task<RegionsServiceClient> | The task representing the created RegionsServiceClient. |
CreateRegion(AccountName, Region, string, CallSettings)
Creates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Region CreateRegion(AccountName parent, Region region, string regionId, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountName | parent | Required. The account to create a region for.
Format: |
Region | region | Required. The region to create. |
string | regionId | Required. The identifier for the region, unique over all regions of the same account. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Region | The RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
Region region = new Region();
string regionId = "";
// Make the request
Region response = regionsServiceClient.CreateRegion(parent, region, regionId);
CreateRegion(CreateRegionRequest, CallSettings)
Creates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Region CreateRegion(CreateRegionRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CreateRegionRequest | 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 |
---|---|
Region | The RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
CreateRegionRequest request = new CreateRegionRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
RegionId = "",
Region = new Region(),
};
// Make the request
Region response = regionsServiceClient.CreateRegion(request);
CreateRegion(string, Region, string, CallSettings)
Creates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Region CreateRegion(string parent, Region region, string regionId, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The account to create a region for.
Format: |
Region | region | Required. The region to create. |
string | regionId | Required. The identifier for the region, unique over all regions of the same account. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Region | The RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
Region region = new Region();
string regionId = "";
// Make the request
Region response = regionsServiceClient.CreateRegion(parent, region, regionId);
CreateRegionAsync(AccountName, Region, string, CallSettings)
Creates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task<Region> CreateRegionAsync(AccountName parent, Region region, string regionId, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountName | parent | Required. The account to create a region for.
Format: |
Region | region | Required. The region to create. |
string | regionId | Required. The identifier for the region, unique over all regions of the same account. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
Region region = new Region();
string regionId = "";
// Make the request
Region response = await regionsServiceClient.CreateRegionAsync(parent, region, regionId);
CreateRegionAsync(AccountName, Region, string, CancellationToken)
Creates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task<Region> CreateRegionAsync(AccountName parent, Region region, string regionId, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
AccountName | parent | Required. The account to create a region for.
Format: |
Region | region | Required. The region to create. |
string | regionId | Required. The identifier for the region, unique over all regions of the same account. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
Region region = new Region();
string regionId = "";
// Make the request
Region response = await regionsServiceClient.CreateRegionAsync(parent, region, regionId);
CreateRegionAsync(CreateRegionRequest, CallSettings)
Creates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task<Region> CreateRegionAsync(CreateRegionRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CreateRegionRequest | 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<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
CreateRegionRequest request = new CreateRegionRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
RegionId = "",
Region = new Region(),
};
// Make the request
Region response = await regionsServiceClient.CreateRegionAsync(request);
CreateRegionAsync(CreateRegionRequest, CancellationToken)
Creates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task<Region> CreateRegionAsync(CreateRegionRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CreateRegionRequest | 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<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
CreateRegionRequest request = new CreateRegionRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
RegionId = "",
Region = new Region(),
};
// Make the request
Region response = await regionsServiceClient.CreateRegionAsync(request);
CreateRegionAsync(string, Region, string, CallSettings)
Creates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task<Region> CreateRegionAsync(string parent, Region region, string regionId, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The account to create a region for.
Format: |
Region | region | Required. The region to create. |
string | regionId | Required. The identifier for the region, unique over all regions of the same account. |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
Region region = new Region();
string regionId = "";
// Make the request
Region response = await regionsServiceClient.CreateRegionAsync(parent, region, regionId);
CreateRegionAsync(string, Region, string, CancellationToken)
Creates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task<Region> CreateRegionAsync(string parent, Region region, string regionId, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The account to create a region for.
Format: |
Region | region | Required. The region to create. |
string | regionId | Required. The identifier for the region, unique over all regions of the same account. |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
Region region = new Region();
string regionId = "";
// Make the request
Region response = await regionsServiceClient.CreateRegionAsync(parent, region, regionId);
DeleteRegion(DeleteRegionRequest, CallSettings)
Deletes a region definition from your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual void DeleteRegion(DeleteRegionRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
DeleteRegionRequest | 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
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
DeleteRegionRequest request = new DeleteRegionRequest
{
RegionName = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]"),
};
// Make the request
regionsServiceClient.DeleteRegion(request);
DeleteRegion(RegionName, CallSettings)
Deletes a region definition from your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual void DeleteRegion(RegionName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RegionName | name | Required. The name of the region to delete.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
RegionName name = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]");
// Make the request
regionsServiceClient.DeleteRegion(name);
DeleteRegion(string, CallSettings)
Deletes a region definition from your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual void DeleteRegion(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the region to delete.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/regions/[REGION]";
// Make the request
regionsServiceClient.DeleteRegion(name);
DeleteRegionAsync(DeleteRegionRequest, CallSettings)
Deletes a region definition from your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task DeleteRegionAsync(DeleteRegionRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
DeleteRegionRequest | 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
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteRegionRequest request = new DeleteRegionRequest
{
RegionName = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]"),
};
// Make the request
await regionsServiceClient.DeleteRegionAsync(request);
DeleteRegionAsync(DeleteRegionRequest, CancellationToken)
Deletes a region definition from your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task DeleteRegionAsync(DeleteRegionRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
DeleteRegionRequest | 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
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteRegionRequest request = new DeleteRegionRequest
{
RegionName = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]"),
};
// Make the request
await regionsServiceClient.DeleteRegionAsync(request);
DeleteRegionAsync(RegionName, CallSettings)
Deletes a region definition from your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task DeleteRegionAsync(RegionName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RegionName | name | Required. The name of the region 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
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
RegionName name = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]");
// Make the request
await regionsServiceClient.DeleteRegionAsync(name);
DeleteRegionAsync(RegionName, CancellationToken)
Deletes a region definition from your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task DeleteRegionAsync(RegionName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
RegionName | name | Required. The name of the region 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
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
RegionName name = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]");
// Make the request
await regionsServiceClient.DeleteRegionAsync(name);
DeleteRegionAsync(string, CallSettings)
Deletes a region definition from your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task DeleteRegionAsync(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the region 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
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/regions/[REGION]";
// Make the request
await regionsServiceClient.DeleteRegionAsync(name);
DeleteRegionAsync(string, CancellationToken)
Deletes a region definition from your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task DeleteRegionAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the region 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
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/regions/[REGION]";
// Make the request
await regionsServiceClient.DeleteRegionAsync(name);
GetRegion(GetRegionRequest, CallSettings)
Retrieves a region defined in your Merchant Center account.
Declaration
public virtual Region GetRegion(GetRegionRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetRegionRequest | 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 |
---|---|
Region | The RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
GetRegionRequest request = new GetRegionRequest
{
RegionName = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]"),
};
// Make the request
Region response = regionsServiceClient.GetRegion(request);
GetRegion(RegionName, CallSettings)
Retrieves a region defined in your Merchant Center account.
Declaration
public virtual Region GetRegion(RegionName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RegionName | name | Required. The name of the region to retrieve.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Region | The RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
RegionName name = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]");
// Make the request
Region response = regionsServiceClient.GetRegion(name);
GetRegion(string, CallSettings)
Retrieves a region defined in your Merchant Center account.
Declaration
public virtual Region GetRegion(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the region to retrieve.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Region | The RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/regions/[REGION]";
// Make the request
Region response = regionsServiceClient.GetRegion(name);
GetRegionAsync(GetRegionRequest, CallSettings)
Retrieves a region defined in your Merchant Center account.
Declaration
public virtual Task<Region> GetRegionAsync(GetRegionRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetRegionRequest | 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<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
GetRegionRequest request = new GetRegionRequest
{
RegionName = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]"),
};
// Make the request
Region response = await regionsServiceClient.GetRegionAsync(request);
GetRegionAsync(GetRegionRequest, CancellationToken)
Retrieves a region defined in your Merchant Center account.
Declaration
public virtual Task<Region> GetRegionAsync(GetRegionRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
GetRegionRequest | 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<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
GetRegionRequest request = new GetRegionRequest
{
RegionName = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]"),
};
// Make the request
Region response = await regionsServiceClient.GetRegionAsync(request);
GetRegionAsync(RegionName, CallSettings)
Retrieves a region defined in your Merchant Center account.
Declaration
public virtual Task<Region> GetRegionAsync(RegionName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RegionName | name | Required. The name of the region to retrieve.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
RegionName name = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]");
// Make the request
Region response = await regionsServiceClient.GetRegionAsync(name);
GetRegionAsync(RegionName, CancellationToken)
Retrieves a region defined in your Merchant Center account.
Declaration
public virtual Task<Region> GetRegionAsync(RegionName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
RegionName | name | Required. The name of the region to retrieve.
Format: |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
RegionName name = RegionName.FromAccountRegion("[ACCOUNT]", "[REGION]");
// Make the request
Region response = await regionsServiceClient.GetRegionAsync(name);
GetRegionAsync(string, CallSettings)
Retrieves a region defined in your Merchant Center account.
Declaration
public virtual Task<Region> GetRegionAsync(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the region to retrieve.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/regions/[REGION]";
// Make the request
Region response = await regionsServiceClient.GetRegionAsync(name);
GetRegionAsync(string, CancellationToken)
Retrieves a region defined in your Merchant Center account.
Declaration
public virtual Task<Region> GetRegionAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The name of the region to retrieve.
Format: |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/regions/[REGION]";
// Make the request
Region response = await regionsServiceClient.GetRegionAsync(name);
ListRegions(AccountName, string, int?, CallSettings)
Lists the regions in your Merchant Center account.
Declaration
public virtual PagedEnumerable<ListRegionsResponse, Region> ListRegions(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountName | parent | Required. The account to list regions for.
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<ListRegionsResponse, Region> | A pageable sequence of Region resources. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedEnumerable<ListRegionsResponse, Region> response = regionsServiceClient.ListRegions(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Region 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 (ListRegionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Region 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<Region> 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 (Region 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;
ListRegions(ListRegionsRequest, CallSettings)
Lists the regions in your Merchant Center account.
Declaration
public virtual PagedEnumerable<ListRegionsResponse, Region> ListRegions(ListRegionsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ListRegionsRequest | 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<ListRegionsResponse, Region> | A pageable sequence of Region resources. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
ListRegionsRequest request = new ListRegionsRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedEnumerable<ListRegionsResponse, Region> response = regionsServiceClient.ListRegions(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Region 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 (ListRegionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Region 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<Region> 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 (Region 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;
ListRegions(string, string, int?, CallSettings)
Lists the regions in your Merchant Center account.
Declaration
public virtual PagedEnumerable<ListRegionsResponse, Region> ListRegions(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The account to list regions for.
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<ListRegionsResponse, Region> | A pageable sequence of Region resources. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedEnumerable<ListRegionsResponse, Region> response = regionsServiceClient.ListRegions(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Region 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 (ListRegionsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Region 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<Region> 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 (Region 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;
ListRegionsAsync(AccountName, string, int?, CallSettings)
Lists the regions in your Merchant Center account.
Declaration
public virtual PagedAsyncEnumerable<ListRegionsResponse, Region> ListRegionsAsync(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AccountName | parent | Required. The account to list regions for.
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<ListRegionsResponse, Region> | A pageable asynchronous sequence of Region resources. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedAsyncEnumerable<ListRegionsResponse, Region> response = regionsServiceClient.ListRegionsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Region 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((ListRegionsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Region 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<Region> 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 (Region 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;
ListRegionsAsync(ListRegionsRequest, CallSettings)
Lists the regions in your Merchant Center account.
Declaration
public virtual PagedAsyncEnumerable<ListRegionsResponse, Region> ListRegionsAsync(ListRegionsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ListRegionsRequest | 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<ListRegionsResponse, Region> | A pageable asynchronous sequence of Region resources. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
ListRegionsRequest request = new ListRegionsRequest
{
ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedAsyncEnumerable<ListRegionsResponse, Region> response = regionsServiceClient.ListRegionsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Region 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((ListRegionsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Region 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<Region> 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 (Region 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;
ListRegionsAsync(string, string, int?, CallSettings)
Lists the regions in your Merchant Center account.
Declaration
public virtual PagedAsyncEnumerable<ListRegionsResponse, Region> ListRegionsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | parent | Required. The account to list regions for.
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<ListRegionsResponse, Region> | A pageable asynchronous sequence of Region resources. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedAsyncEnumerable<ListRegionsResponse, Region> response = regionsServiceClient.ListRegionsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Region 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((ListRegionsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Region 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<Region> 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 (Region 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.
UpdateRegion(Region, FieldMask, CallSettings)
Updates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Region UpdateRegion(Region region, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
Region | region | Required. The updated region. |
FieldMask | updateMask | Optional. The comma-separated field mask indicating the fields to update.
Example:
|
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Region | The RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
Region region = new Region();
FieldMask updateMask = new FieldMask();
// Make the request
Region response = regionsServiceClient.UpdateRegion(region, updateMask);
UpdateRegion(UpdateRegionRequest, CallSettings)
Updates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Region UpdateRegion(UpdateRegionRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
UpdateRegionRequest | 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 |
---|---|
Region | The RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = RegionsServiceClient.Create();
// Initialize request argument(s)
UpdateRegionRequest request = new UpdateRegionRequest
{
Region = new Region(),
UpdateMask = new FieldMask(),
};
// Make the request
Region response = regionsServiceClient.UpdateRegion(request);
UpdateRegionAsync(Region, FieldMask, CallSettings)
Updates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task<Region> UpdateRegionAsync(Region region, FieldMask updateMask, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
Region | region | Required. The updated region. |
FieldMask | updateMask | Optional. The comma-separated field mask indicating the fields to update.
Example:
|
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
Region region = new Region();
FieldMask updateMask = new FieldMask();
// Make the request
Region response = await regionsServiceClient.UpdateRegionAsync(region, updateMask);
UpdateRegionAsync(Region, FieldMask, CancellationToken)
Updates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task<Region> UpdateRegionAsync(Region region, FieldMask updateMask, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Region | region | Required. The updated region. |
FieldMask | updateMask | Optional. The comma-separated field mask indicating the fields to update.
Example:
|
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
Region region = new Region();
FieldMask updateMask = new FieldMask();
// Make the request
Region response = await regionsServiceClient.UpdateRegionAsync(region, updateMask);
UpdateRegionAsync(UpdateRegionRequest, CallSettings)
Updates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task<Region> UpdateRegionAsync(UpdateRegionRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
UpdateRegionRequest | 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<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateRegionRequest request = new UpdateRegionRequest
{
Region = new Region(),
UpdateMask = new FieldMask(),
};
// Make the request
Region response = await regionsServiceClient.UpdateRegionAsync(request);
UpdateRegionAsync(UpdateRegionRequest, CancellationToken)
Updates a region definition in your Merchant Center account. Executing this method requires admin access.
Declaration
public virtual Task<Region> UpdateRegionAsync(UpdateRegionRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
UpdateRegionRequest | 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<Region> | A Task containing the RPC response. |
Sample code
// Create client
RegionsServiceClient regionsServiceClient = await RegionsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateRegionRequest request = new UpdateRegionRequest
{
Region = new Region(),
UpdateMask = new FieldMask(),
};
// Make the request
Region response = await regionsServiceClient.UpdateRegionAsync(request);