Show / Hide Table of Contents

Class ProductReviewsServiceClient

ProductReviewsService client wrapper, for convenient use.

Inheritance
object
ProductReviewsServiceClient
ProductReviewsServiceClientImpl
Inherited Members
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ToString()
Namespace: Google.Shopping.Merchant.Reviews.V1Beta
Assembly: Google.Shopping.Merchant.Reviews.V1Beta.dll
Syntax
public abstract class ProductReviewsServiceClient
Remarks

Service to manage product reviews.

Properties

DefaultEndpoint

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

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

The default ProductReviewsService scopes are:

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

GrpcClient

The underlying gRPC ProductReviewsService client

Declaration
public virtual ProductReviewsService.ProductReviewsServiceClient GrpcClient { get; }
Property Value
Type Description
ProductReviewsService.ProductReviewsServiceClient

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

Declaration
public static ProductReviewsServiceClient Create()
Returns
Type Description
ProductReviewsServiceClient

The created ProductReviewsServiceClient.

CreateAsync(CancellationToken)

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

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

The CancellationToken to use while creating the client.

Returns
Type Description
Task<ProductReviewsServiceClient>

The task representing the created ProductReviewsServiceClient.

DeleteProductReview(DeleteProductReviewRequest, CallSettings)

Deletes a product review.

Declaration
public virtual void DeleteProductReview(DeleteProductReviewRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteProductReviewRequest 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
ProductReviewsServiceClient productReviewsServiceClient = ProductReviewsServiceClient.Create();
// Initialize request argument(s)
DeleteProductReviewRequest request = new DeleteProductReviewRequest
{
    ProductReviewName = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]"),
};
// Make the request
productReviewsServiceClient.DeleteProductReview(request);

DeleteProductReview(ProductReviewName, CallSettings)

Deletes a product review.

Declaration
public virtual void DeleteProductReview(ProductReviewName name, CallSettings callSettings = null)
Parameters
Type Name Description
ProductReviewName name

Required. The ID of the Product review. Format: accounts/{account}/productReviews/{productReview}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = ProductReviewsServiceClient.Create();
// Initialize request argument(s)
ProductReviewName name = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]");
// Make the request
productReviewsServiceClient.DeleteProductReview(name);

DeleteProductReview(string, CallSettings)

Deletes a product review.

Declaration
public virtual void DeleteProductReview(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The ID of the Product review. Format: accounts/{account}/productReviews/{productReview}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = ProductReviewsServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/productReviews/[PRODUCTREVIEW]";
// Make the request
productReviewsServiceClient.DeleteProductReview(name);

DeleteProductReviewAsync(DeleteProductReviewRequest, CallSettings)

Deletes a product review.

Declaration
public virtual Task DeleteProductReviewAsync(DeleteProductReviewRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteProductReviewRequest 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
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteProductReviewRequest request = new DeleteProductReviewRequest
{
    ProductReviewName = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]"),
};
// Make the request
await productReviewsServiceClient.DeleteProductReviewAsync(request);

DeleteProductReviewAsync(DeleteProductReviewRequest, CancellationToken)

Deletes a product review.

Declaration
public virtual Task DeleteProductReviewAsync(DeleteProductReviewRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
DeleteProductReviewRequest 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
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteProductReviewRequest request = new DeleteProductReviewRequest
{
    ProductReviewName = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]"),
};
// Make the request
await productReviewsServiceClient.DeleteProductReviewAsync(request);

DeleteProductReviewAsync(ProductReviewName, CallSettings)

Deletes a product review.

Declaration
public virtual Task DeleteProductReviewAsync(ProductReviewName name, CallSettings callSettings = null)
Parameters
Type Name Description
ProductReviewName name

Required. The ID of the Product review. Format: accounts/{account}/productReviews/{productReview}

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
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
ProductReviewName name = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]");
// Make the request
await productReviewsServiceClient.DeleteProductReviewAsync(name);

DeleteProductReviewAsync(ProductReviewName, CancellationToken)

Deletes a product review.

Declaration
public virtual Task DeleteProductReviewAsync(ProductReviewName name, CancellationToken cancellationToken)
Parameters
Type Name Description
ProductReviewName name

Required. The ID of the Product review. Format: accounts/{account}/productReviews/{productReview}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
ProductReviewName name = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]");
// Make the request
await productReviewsServiceClient.DeleteProductReviewAsync(name);

DeleteProductReviewAsync(string, CallSettings)

Deletes a product review.

Declaration
public virtual Task DeleteProductReviewAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The ID of the Product review. Format: accounts/{account}/productReviews/{productReview}

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
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/productReviews/[PRODUCTREVIEW]";
// Make the request
await productReviewsServiceClient.DeleteProductReviewAsync(name);

DeleteProductReviewAsync(string, CancellationToken)

Deletes a product review.

Declaration
public virtual Task DeleteProductReviewAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. The ID of the Product review. Format: accounts/{account}/productReviews/{productReview}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/productReviews/[PRODUCTREVIEW]";
// Make the request
await productReviewsServiceClient.DeleteProductReviewAsync(name);

GetProductReview(GetProductReviewRequest, CallSettings)

Gets a product review.

Declaration
public virtual ProductReview GetProductReview(GetProductReviewRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetProductReviewRequest 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
ProductReview

The RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = ProductReviewsServiceClient.Create();
// Initialize request argument(s)
GetProductReviewRequest request = new GetProductReviewRequest
{
    ProductReviewName = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]"),
};
// Make the request
ProductReview response = productReviewsServiceClient.GetProductReview(request);

GetProductReview(ProductReviewName, CallSettings)

Gets a product review.

Declaration
public virtual ProductReview GetProductReview(ProductReviewName name, CallSettings callSettings = null)
Parameters
Type Name Description
ProductReviewName name

Required. The ID of the merchant review. Format: accounts/{account}/productReviews/{productReview}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ProductReview

The RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = ProductReviewsServiceClient.Create();
// Initialize request argument(s)
ProductReviewName name = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]");
// Make the request
ProductReview response = productReviewsServiceClient.GetProductReview(name);

GetProductReview(string, CallSettings)

Gets a product review.

Declaration
public virtual ProductReview GetProductReview(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The ID of the merchant review. Format: accounts/{account}/productReviews/{productReview}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ProductReview

The RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = ProductReviewsServiceClient.Create();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/productReviews/[PRODUCTREVIEW]";
// Make the request
ProductReview response = productReviewsServiceClient.GetProductReview(name);

GetProductReviewAsync(GetProductReviewRequest, CallSettings)

Gets a product review.

Declaration
public virtual Task<ProductReview> GetProductReviewAsync(GetProductReviewRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetProductReviewRequest 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<ProductReview>

A Task containing the RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
GetProductReviewRequest request = new GetProductReviewRequest
{
    ProductReviewName = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]"),
};
// Make the request
ProductReview response = await productReviewsServiceClient.GetProductReviewAsync(request);

GetProductReviewAsync(GetProductReviewRequest, CancellationToken)

Gets a product review.

Declaration
public virtual Task<ProductReview> GetProductReviewAsync(GetProductReviewRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetProductReviewRequest 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<ProductReview>

A Task containing the RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
GetProductReviewRequest request = new GetProductReviewRequest
{
    ProductReviewName = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]"),
};
// Make the request
ProductReview response = await productReviewsServiceClient.GetProductReviewAsync(request);

GetProductReviewAsync(ProductReviewName, CallSettings)

Gets a product review.

Declaration
public virtual Task<ProductReview> GetProductReviewAsync(ProductReviewName name, CallSettings callSettings = null)
Parameters
Type Name Description
ProductReviewName name

Required. The ID of the merchant review. Format: accounts/{account}/productReviews/{productReview}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<ProductReview>

A Task containing the RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
ProductReviewName name = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]");
// Make the request
ProductReview response = await productReviewsServiceClient.GetProductReviewAsync(name);

GetProductReviewAsync(ProductReviewName, CancellationToken)

Gets a product review.

Declaration
public virtual Task<ProductReview> GetProductReviewAsync(ProductReviewName name, CancellationToken cancellationToken)
Parameters
Type Name Description
ProductReviewName name

Required. The ID of the merchant review. Format: accounts/{account}/productReviews/{productReview}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<ProductReview>

A Task containing the RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
ProductReviewName name = ProductReviewName.FromAccountProductreview("[ACCOUNT]", "[PRODUCTREVIEW]");
// Make the request
ProductReview response = await productReviewsServiceClient.GetProductReviewAsync(name);

GetProductReviewAsync(string, CallSettings)

Gets a product review.

Declaration
public virtual Task<ProductReview> GetProductReviewAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. The ID of the merchant review. Format: accounts/{account}/productReviews/{productReview}

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task<ProductReview>

A Task containing the RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/productReviews/[PRODUCTREVIEW]";
// Make the request
ProductReview response = await productReviewsServiceClient.GetProductReviewAsync(name);

GetProductReviewAsync(string, CancellationToken)

Gets a product review.

Declaration
public virtual Task<ProductReview> GetProductReviewAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. The ID of the merchant review. Format: accounts/{account}/productReviews/{productReview}

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<ProductReview>

A Task containing the RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "accounts/[ACCOUNT]/productReviews/[PRODUCTREVIEW]";
// Make the request
ProductReview response = await productReviewsServiceClient.GetProductReviewAsync(name);

InsertProductReview(InsertProductReviewRequest, CallSettings)

Inserts a product review.

Declaration
public virtual ProductReview InsertProductReview(InsertProductReviewRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
InsertProductReviewRequest 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
ProductReview

The RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = ProductReviewsServiceClient.Create();
// Initialize request argument(s)
InsertProductReviewRequest request = new InsertProductReviewRequest
{
    Parent = "",
    ProductReview = new ProductReview(),
    DataSource = "",
};
// Make the request
ProductReview response = productReviewsServiceClient.InsertProductReview(request);

InsertProductReviewAsync(InsertProductReviewRequest, CallSettings)

Inserts a product review.

Declaration
public virtual Task<ProductReview> InsertProductReviewAsync(InsertProductReviewRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
InsertProductReviewRequest 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<ProductReview>

A Task containing the RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
InsertProductReviewRequest request = new InsertProductReviewRequest
{
    Parent = "",
    ProductReview = new ProductReview(),
    DataSource = "",
};
// Make the request
ProductReview response = await productReviewsServiceClient.InsertProductReviewAsync(request);

InsertProductReviewAsync(InsertProductReviewRequest, CancellationToken)

Inserts a product review.

Declaration
public virtual Task<ProductReview> InsertProductReviewAsync(InsertProductReviewRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
InsertProductReviewRequest 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<ProductReview>

A Task containing the RPC response.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
InsertProductReviewRequest request = new InsertProductReviewRequest
{
    Parent = "",
    ProductReview = new ProductReview(),
    DataSource = "",
};
// Make the request
ProductReview response = await productReviewsServiceClient.InsertProductReviewAsync(request);

ListProductReviews(AccountName, string, int?, CallSettings)

Lists product reviews.

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

Required. The account to list product reviews for. 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<ListProductReviewsResponse, ProductReview>

A pageable sequence of ProductReview resources.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = ProductReviewsServiceClient.Create();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedEnumerable<ListProductReviewsResponse, ProductReview> response = productReviewsServiceClient.ListProductReviews(parent);

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

ListProductReviews(ListProductReviewsRequest, CallSettings)

Lists product reviews.

Declaration
public virtual PagedEnumerable<ListProductReviewsResponse, ProductReview> ListProductReviews(ListProductReviewsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListProductReviewsRequest 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<ListProductReviewsResponse, ProductReview>

A pageable sequence of ProductReview resources.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = ProductReviewsServiceClient.Create();
// Initialize request argument(s)
ListProductReviewsRequest request = new ListProductReviewsRequest
{
    ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedEnumerable<ListProductReviewsResponse, ProductReview> response = productReviewsServiceClient.ListProductReviews(request);

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

ListProductReviews(string, string, int?, CallSettings)

Lists product reviews.

Declaration
public virtual PagedEnumerable<ListProductReviewsResponse, ProductReview> ListProductReviews(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The account to list product reviews for. 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<ListProductReviewsResponse, ProductReview>

A pageable sequence of ProductReview resources.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = ProductReviewsServiceClient.Create();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedEnumerable<ListProductReviewsResponse, ProductReview> response = productReviewsServiceClient.ListProductReviews(parent);

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

ListProductReviewsAsync(AccountName, string, int?, CallSettings)

Lists product reviews.

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

Required. The account to list product reviews for. 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<ListProductReviewsResponse, ProductReview>

A pageable asynchronous sequence of ProductReview resources.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
AccountName parent = AccountName.FromAccount("[ACCOUNT]");
// Make the request
PagedAsyncEnumerable<ListProductReviewsResponse, ProductReview> response = productReviewsServiceClient.ListProductReviewsAsync(parent);

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

ListProductReviewsAsync(ListProductReviewsRequest, CallSettings)

Lists product reviews.

Declaration
public virtual PagedAsyncEnumerable<ListProductReviewsResponse, ProductReview> ListProductReviewsAsync(ListProductReviewsRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListProductReviewsRequest 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<ListProductReviewsResponse, ProductReview>

A pageable asynchronous sequence of ProductReview resources.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
ListProductReviewsRequest request = new ListProductReviewsRequest
{
    ParentAsAccountName = AccountName.FromAccount("[ACCOUNT]"),
};
// Make the request
PagedAsyncEnumerable<ListProductReviewsResponse, ProductReview> response = productReviewsServiceClient.ListProductReviewsAsync(request);

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

ListProductReviewsAsync(string, string, int?, CallSettings)

Lists product reviews.

Declaration
public virtual PagedAsyncEnumerable<ListProductReviewsResponse, ProductReview> ListProductReviewsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Parameters
Type Name Description
string parent

Required. The account to list product reviews for. 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<ListProductReviewsResponse, ProductReview>

A pageable asynchronous sequence of ProductReview resources.

Sample code
// Create client
ProductReviewsServiceClient productReviewsServiceClient = await ProductReviewsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "accounts/[ACCOUNT]";
// Make the request
PagedAsyncEnumerable<ListProductReviewsResponse, ProductReview> response = productReviewsServiceClient.ListProductReviewsAsync(parent);

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