Show / Hide Table of Contents

Class QuotaServiceClient

QuotaService client wrapper, for convenient use.

Inheritance
object
QuotaServiceClient
QuotaServiceClientImpl
Inherited Members
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ToString()
Namespace: Google.Shopping.Merchant.Quota.V1
Assembly: Google.Shopping.Merchant.Quota.V1.dll
Syntax
public abstract class QuotaServiceClient
Remarks

Service to get method call quota information per Merchant API method.

Properties

DefaultEndpoint

The default endpoint for the QuotaService 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 QuotaService scopes.

Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type Description
IReadOnlyList<string>
Remarks

The default QuotaService scopes are:

  • https://www.googleapis.com/auth/content

GrpcClient

The underlying gRPC QuotaService client

Declaration
public virtual QuotaService.QuotaServiceClient GrpcClient { get; }
Property Value
Type Description
QuotaService.QuotaServiceClient

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 QuotaServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use QuotaServiceClientBuilder.

Declaration
public static QuotaServiceClient Create()
Returns
Type Description
QuotaServiceClient

The created QuotaServiceClient.

CreateAsync(CancellationToken)

Asynchronously creates a QuotaServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use QuotaServiceClientBuilder.

Declaration
public static Task<QuotaServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
Task<QuotaServiceClient>

The task representing the created QuotaServiceClient.

ListQuotaGroups(AccountName, string, int?, CallSettings)

Lists the daily call quota and usage per group for your Merchant Center account.

Declaration
public virtual PagedEnumerable<ListQuotaGroupsResponse, QuotaGroup> ListQuotaGroups(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
AccountName parent

Required. The merchant account who owns the collection of method quotas Format: accounts/{account}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListQuotaGroupsResponse, QuotaGroup>

A pageable sequence of QuotaGroup resources.

Sample code
// Create client
QuotaServiceClient quotaServiceClient = QuotaServiceClient.Create();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedEnumerable<ListQuotaGroupsResponse, QuotaGroup> response = quotaServiceClient.ListQuotaGroups(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (QuotaGroup 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 (ListQuotaGroupsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (QuotaGroup 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<QuotaGroup> 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 (QuotaGroup 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;

ListQuotaGroups(ListQuotaGroupsRequest, CallSettings)

Lists the daily call quota and usage per group for your Merchant Center account.

Declaration
public virtual PagedEnumerable<ListQuotaGroupsResponse, QuotaGroup> ListQuotaGroups(ListQuotaGroupsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListQuotaGroupsRequest 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<ListQuotaGroupsResponse, QuotaGroup>

A pageable sequence of QuotaGroup resources.

Sample code
// Create client
QuotaServiceClient quotaServiceClient = QuotaServiceClient.Create();
// Initialize request argument(s)
ListQuotaGroupsRequest request = new ListQuotaGroupsRequest
{
    ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedEnumerable<ListQuotaGroupsResponse, QuotaGroup> response = quotaServiceClient.ListQuotaGroups(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (QuotaGroup 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 (ListQuotaGroupsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (QuotaGroup 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<QuotaGroup> 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 (QuotaGroup 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;

ListQuotaGroups(string, string, int?, CallSettings)

Lists the daily call quota and usage per group for your Merchant Center account.

Declaration
public virtual PagedEnumerable<ListQuotaGroupsResponse, QuotaGroup> ListQuotaGroups(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The merchant account who owns the collection of method quotas Format: accounts/{account}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerable<ListQuotaGroupsResponse, QuotaGroup>

A pageable sequence of QuotaGroup resources.

Sample code
// Create client
QuotaServiceClient quotaServiceClient = QuotaServiceClient.Create();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedEnumerable<ListQuotaGroupsResponse, QuotaGroup> response = quotaServiceClient.ListQuotaGroups(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (QuotaGroup 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 (ListQuotaGroupsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (QuotaGroup 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<QuotaGroup> 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 (QuotaGroup 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;

ListQuotaGroupsAsync(AccountName, string, int?, CallSettings)

Lists the daily call quota and usage per group for your Merchant Center account.

Declaration
public virtual PagedAsyncEnumerable<ListQuotaGroupsResponse, QuotaGroup> ListQuotaGroupsAsync(AccountName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
AccountName parent

Required. The merchant account who owns the collection of method quotas Format: accounts/{account}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListQuotaGroupsResponse, QuotaGroup>

A pageable asynchronous sequence of QuotaGroup resources.

Sample code
// Create client
QuotaServiceClient quotaServiceClient = await QuotaServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedAsyncEnumerable<ListQuotaGroupsResponse, QuotaGroup> response = quotaServiceClient.ListQuotaGroupsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((QuotaGroup 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((ListQuotaGroupsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (QuotaGroup 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<QuotaGroup> 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 (QuotaGroup 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;

ListQuotaGroupsAsync(ListQuotaGroupsRequest, CallSettings)

Lists the daily call quota and usage per group for your Merchant Center account.

Declaration
public virtual PagedAsyncEnumerable<ListQuotaGroupsResponse, QuotaGroup> ListQuotaGroupsAsync(ListQuotaGroupsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListQuotaGroupsRequest 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<ListQuotaGroupsResponse, QuotaGroup>

A pageable asynchronous sequence of QuotaGroup resources.

Sample code
// Create client
QuotaServiceClient quotaServiceClient = await QuotaServiceClient.CreateAsync();
// Initialize request argument(s)
ListQuotaGroupsRequest request = new ListQuotaGroupsRequest
{
    ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedAsyncEnumerable<ListQuotaGroupsResponse, QuotaGroup> response = quotaServiceClient.ListQuotaGroupsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((QuotaGroup 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((ListQuotaGroupsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (QuotaGroup 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<QuotaGroup> 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 (QuotaGroup 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;

ListQuotaGroupsAsync(string, string, int?, CallSettings)

Lists the daily call quota and usage per group for your Merchant Center account.

Declaration
public virtual PagedAsyncEnumerable<ListQuotaGroupsResponse, QuotaGroup> ListQuotaGroupsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The merchant account who owns the collection of method quotas Format: accounts/{account}

string pageToken

The token returned from the previous request. A value of null or an empty string retrieves the first page.

int? pageSize

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerable<ListQuotaGroupsResponse, QuotaGroup>

A pageable asynchronous sequence of QuotaGroup resources.

Sample code
// Create client
QuotaServiceClient quotaServiceClient = await QuotaServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedAsyncEnumerable<ListQuotaGroupsResponse, QuotaGroup> response = quotaServiceClient.ListQuotaGroupsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((QuotaGroup 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((ListQuotaGroupsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (QuotaGroup 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<QuotaGroup> 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 (QuotaGroup 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.

In this article
Back to top Generated by DocFX