Class TermsOfServiceServiceClient
TermsOfServiceService client wrapper, for convenient use.
Namespace: Google.Shopping.Merchant.Accounts.V1Beta
Assembly: Google.Shopping.Merchant.Accounts.V1Beta.dll
Syntax
public abstract class TermsOfServiceServiceClient
Remarks
Service to support TermsOfService
API.
Properties
DefaultEndpoint
The default endpoint for the TermsOfServiceService 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 TermsOfServiceService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<string> |
Remarks
The default TermsOfServiceService scopes are:
- https://www.googleapis.com/auth/content
GrpcClient
The underlying gRPC TermsOfServiceService client
Declaration
public virtual TermsOfServiceService.TermsOfServiceServiceClient GrpcClient { get; }
Property Value
Type | Description |
---|---|
TermsOfServiceService.TermsOfServiceServiceClient |
ServiceMetadata
The service metadata associated with this client type.
Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
Type | Description |
---|---|
ServiceMetadata |
Methods
AcceptTermsOfService(AcceptTermsOfServiceRequest, CallSettings)
Accepts a TermsOfService
. Executing this method requires admin access.
Declaration
public virtual void AcceptTermsOfService(AcceptTermsOfServiceRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AcceptTermsOfServiceRequest | 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
TermsOfServiceServiceClient termsOfServiceServiceClient = TermsOfServiceServiceClient.Create();
// Initialize request argument(s)
AcceptTermsOfServiceRequest request = new AcceptTermsOfServiceRequest
{
TermsOfServiceName = TermsOfServiceName.FromVersion("[VERSION]"),
AccountAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
RegionCode = "",
};
// Make the request
termsOfServiceServiceClient.AcceptTermsOfService(request);
AcceptTermsOfService(TermsOfServiceName, CallSettings)
Accepts a TermsOfService
. Executing this method requires admin access.
Declaration
public virtual void AcceptTermsOfService(TermsOfServiceName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
TermsOfServiceName | name | Required. The resource name of the terms of service version.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = TermsOfServiceServiceClient.Create();
// Initialize request argument(s)
TermsOfServiceName name = TermsOfServiceName.FromVersion("[VERSION]");
// Make the request
termsOfServiceServiceClient.AcceptTermsOfService(name);
AcceptTermsOfService(string, CallSettings)
Accepts a TermsOfService
. Executing this method requires admin access.
Declaration
public virtual void AcceptTermsOfService(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the terms of service version.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = TermsOfServiceServiceClient.Create();
// Initialize request argument(s)
string name = "termsOfService/[VERSION]";
// Make the request
termsOfServiceServiceClient.AcceptTermsOfService(name);
AcceptTermsOfServiceAsync(AcceptTermsOfServiceRequest, CallSettings)
Accepts a TermsOfService
. Executing this method requires admin access.
Declaration
public virtual Task AcceptTermsOfServiceAsync(AcceptTermsOfServiceRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
AcceptTermsOfServiceRequest | 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
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
AcceptTermsOfServiceRequest request = new AcceptTermsOfServiceRequest
{
TermsOfServiceName = TermsOfServiceName.FromVersion("[VERSION]"),
AccountAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
RegionCode = "",
};
// Make the request
await termsOfServiceServiceClient.AcceptTermsOfServiceAsync(request);
AcceptTermsOfServiceAsync(AcceptTermsOfServiceRequest, CancellationToken)
Accepts a TermsOfService
. Executing this method requires admin access.
Declaration
public virtual Task AcceptTermsOfServiceAsync(AcceptTermsOfServiceRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
AcceptTermsOfServiceRequest | 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
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
AcceptTermsOfServiceRequest request = new AcceptTermsOfServiceRequest
{
TermsOfServiceName = TermsOfServiceName.FromVersion("[VERSION]"),
AccountAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
RegionCode = "",
};
// Make the request
await termsOfServiceServiceClient.AcceptTermsOfServiceAsync(request);
AcceptTermsOfServiceAsync(TermsOfServiceName, CallSettings)
Accepts a TermsOfService
. Executing this method requires admin access.
Declaration
public virtual Task AcceptTermsOfServiceAsync(TermsOfServiceName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
TermsOfServiceName | name | Required. The resource name of the terms of service version.
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
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
TermsOfServiceName name = TermsOfServiceName.FromVersion("[VERSION]");
// Make the request
await termsOfServiceServiceClient.AcceptTermsOfServiceAsync(name);
AcceptTermsOfServiceAsync(TermsOfServiceName, CancellationToken)
Accepts a TermsOfService
. Executing this method requires admin access.
Declaration
public virtual Task AcceptTermsOfServiceAsync(TermsOfServiceName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
TermsOfServiceName | name | Required. The resource name of the terms of service version.
Format: |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task | A Task containing the RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
TermsOfServiceName name = TermsOfServiceName.FromVersion("[VERSION]");
// Make the request
await termsOfServiceServiceClient.AcceptTermsOfServiceAsync(name);
AcceptTermsOfServiceAsync(string, CallSettings)
Accepts a TermsOfService
. Executing this method requires admin access.
Declaration
public virtual Task AcceptTermsOfServiceAsync(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the terms of service version.
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
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "termsOfService/[VERSION]";
// Make the request
await termsOfServiceServiceClient.AcceptTermsOfServiceAsync(name);
AcceptTermsOfServiceAsync(string, CancellationToken)
Accepts a TermsOfService
. Executing this method requires admin access.
Declaration
public virtual Task AcceptTermsOfServiceAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the terms of service version.
Format: |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task | A Task containing the RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "termsOfService/[VERSION]";
// Make the request
await termsOfServiceServiceClient.AcceptTermsOfServiceAsync(name);
Create()
Synchronously creates a TermsOfServiceServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use TermsOfServiceServiceClientBuilder.
Declaration
public static TermsOfServiceServiceClient Create()
Returns
Type | Description |
---|---|
TermsOfServiceServiceClient | The created TermsOfServiceServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a TermsOfServiceServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use TermsOfServiceServiceClientBuilder.
Declaration
public static Task<TermsOfServiceServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
Type | Description |
---|---|
Task<TermsOfServiceServiceClient> | The task representing the created TermsOfServiceServiceClient. |
GetTermsOfService(GetTermsOfServiceRequest, CallSettings)
Retrieves the TermsOfService
associated with the provided version.
Declaration
public virtual TermsOfService GetTermsOfService(GetTermsOfServiceRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetTermsOfServiceRequest | 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 |
---|---|
TermsOfService | The RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = TermsOfServiceServiceClient.Create();
// Initialize request argument(s)
GetTermsOfServiceRequest request = new GetTermsOfServiceRequest
{
TermsOfServiceName = TermsOfServiceName.FromVersion("[VERSION]"),
};
// Make the request
TermsOfService response = termsOfServiceServiceClient.GetTermsOfService(request);
GetTermsOfService(TermsOfServiceName, CallSettings)
Retrieves the TermsOfService
associated with the provided version.
Declaration
public virtual TermsOfService GetTermsOfService(TermsOfServiceName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
TermsOfServiceName | name | Required. The resource name of the terms of service version.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
TermsOfService | The RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = TermsOfServiceServiceClient.Create();
// Initialize request argument(s)
TermsOfServiceName name = TermsOfServiceName.FromVersion("[VERSION]");
// Make the request
TermsOfService response = termsOfServiceServiceClient.GetTermsOfService(name);
GetTermsOfService(string, CallSettings)
Retrieves the TermsOfService
associated with the provided version.
Declaration
public virtual TermsOfService GetTermsOfService(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the terms of service version.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
TermsOfService | The RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = TermsOfServiceServiceClient.Create();
// Initialize request argument(s)
string name = "termsOfService/[VERSION]";
// Make the request
TermsOfService response = termsOfServiceServiceClient.GetTermsOfService(name);
GetTermsOfServiceAsync(GetTermsOfServiceRequest, CallSettings)
Retrieves the TermsOfService
associated with the provided version.
Declaration
public virtual Task<TermsOfService> GetTermsOfServiceAsync(GetTermsOfServiceRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetTermsOfServiceRequest | 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<TermsOfService> | A Task containing the RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
GetTermsOfServiceRequest request = new GetTermsOfServiceRequest
{
TermsOfServiceName = TermsOfServiceName.FromVersion("[VERSION]"),
};
// Make the request
TermsOfService response = await termsOfServiceServiceClient.GetTermsOfServiceAsync(request);
GetTermsOfServiceAsync(GetTermsOfServiceRequest, CancellationToken)
Retrieves the TermsOfService
associated with the provided version.
Declaration
public virtual Task<TermsOfService> GetTermsOfServiceAsync(GetTermsOfServiceRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
GetTermsOfServiceRequest | 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<TermsOfService> | A Task containing the RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
GetTermsOfServiceRequest request = new GetTermsOfServiceRequest
{
TermsOfServiceName = TermsOfServiceName.FromVersion("[VERSION]"),
};
// Make the request
TermsOfService response = await termsOfServiceServiceClient.GetTermsOfServiceAsync(request);
GetTermsOfServiceAsync(TermsOfServiceName, CallSettings)
Retrieves the TermsOfService
associated with the provided version.
Declaration
public virtual Task<TermsOfService> GetTermsOfServiceAsync(TermsOfServiceName name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
TermsOfServiceName | name | Required. The resource name of the terms of service version.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<TermsOfService> | A Task containing the RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
TermsOfServiceName name = TermsOfServiceName.FromVersion("[VERSION]");
// Make the request
TermsOfService response = await termsOfServiceServiceClient.GetTermsOfServiceAsync(name);
GetTermsOfServiceAsync(TermsOfServiceName, CancellationToken)
Retrieves the TermsOfService
associated with the provided version.
Declaration
public virtual Task<TermsOfService> GetTermsOfServiceAsync(TermsOfServiceName name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
TermsOfServiceName | name | Required. The resource name of the terms of service version.
Format: |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<TermsOfService> | A Task containing the RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
TermsOfServiceName name = TermsOfServiceName.FromVersion("[VERSION]");
// Make the request
TermsOfService response = await termsOfServiceServiceClient.GetTermsOfServiceAsync(name);
GetTermsOfServiceAsync(string, CallSettings)
Retrieves the TermsOfService
associated with the provided version.
Declaration
public virtual Task<TermsOfService> GetTermsOfServiceAsync(string name, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the terms of service version.
Format: |
CallSettings | callSettings | If not null, applies overrides to this RPC call. |
Returns
Type | Description |
---|---|
Task<TermsOfService> | A Task containing the RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "termsOfService/[VERSION]";
// Make the request
TermsOfService response = await termsOfServiceServiceClient.GetTermsOfServiceAsync(name);
GetTermsOfServiceAsync(string, CancellationToken)
Retrieves the TermsOfService
associated with the provided version.
Declaration
public virtual Task<TermsOfService> GetTermsOfServiceAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
string | name | Required. The resource name of the terms of service version.
Format: |
CancellationToken | cancellationToken | A CancellationToken to use for this RPC. |
Returns
Type | Description |
---|---|
Task<TermsOfService> | A Task containing the RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "termsOfService/[VERSION]";
// Make the request
TermsOfService response = await termsOfServiceServiceClient.GetTermsOfServiceAsync(name);
RetrieveLatestTermsOfService(RetrieveLatestTermsOfServiceRequest, CallSettings)
Retrieves the latest version of the TermsOfService
for a given kind
and
region_code
.
Declaration
public virtual TermsOfService RetrieveLatestTermsOfService(RetrieveLatestTermsOfServiceRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RetrieveLatestTermsOfServiceRequest | 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 |
---|---|
TermsOfService | The RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = TermsOfServiceServiceClient.Create();
// Initialize request argument(s)
RetrieveLatestTermsOfServiceRequest request = new RetrieveLatestTermsOfServiceRequest
{
RegionCode = "",
Kind = TermsOfServiceKind.Unspecified,
};
// Make the request
TermsOfService response = termsOfServiceServiceClient.RetrieveLatestTermsOfService(request);
RetrieveLatestTermsOfServiceAsync(RetrieveLatestTermsOfServiceRequest, CallSettings)
Retrieves the latest version of the TermsOfService
for a given kind
and
region_code
.
Declaration
public virtual Task<TermsOfService> RetrieveLatestTermsOfServiceAsync(RetrieveLatestTermsOfServiceRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
RetrieveLatestTermsOfServiceRequest | 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<TermsOfService> | A Task containing the RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
RetrieveLatestTermsOfServiceRequest request = new RetrieveLatestTermsOfServiceRequest
{
RegionCode = "",
Kind = TermsOfServiceKind.Unspecified,
};
// Make the request
TermsOfService response = await termsOfServiceServiceClient.RetrieveLatestTermsOfServiceAsync(request);
RetrieveLatestTermsOfServiceAsync(RetrieveLatestTermsOfServiceRequest, CancellationToken)
Retrieves the latest version of the TermsOfService
for a given kind
and
region_code
.
Declaration
public virtual Task<TermsOfService> RetrieveLatestTermsOfServiceAsync(RetrieveLatestTermsOfServiceRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
RetrieveLatestTermsOfServiceRequest | 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<TermsOfService> | A Task containing the RPC response. |
Sample code
// Create client
TermsOfServiceServiceClient termsOfServiceServiceClient = await TermsOfServiceServiceClient.CreateAsync();
// Initialize request argument(s)
RetrieveLatestTermsOfServiceRequest request = new RetrieveLatestTermsOfServiceRequest
{
RegionCode = "",
Kind = TermsOfServiceKind.Unspecified,
};
// Make the request
TermsOfService response = await termsOfServiceServiceClient.RetrieveLatestTermsOfServiceAsync(request);
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.