Class ProductSearchClient (3.0.0)

public abstract class ProductSearchClient

ProductSearch client wrapper, for convenient use.

Inheritance

Object > ProductSearchClient

Derived Types

Namespace

Google.Cloud.Vision.V1

Assembly

Google.Cloud.Vision.V1.dll

Remarks

Manages Products and ProductSets of reference images for use in product search. It uses the following resource model:

  • The API has a collection of [ProductSet][google.cloud.vision.v1.ProductSet] resources, named projects/*/locations/*/productSets/*, which acts as a way to put different products into groups to limit identification.

In parallel,

  • The API has a collection of [Product][google.cloud.vision.v1.Product] resources, named projects/*/locations/*/products/*

  • Each [Product][google.cloud.vision.v1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, named projects/*/locations/*/products/*/referenceImages/*

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the ProductSearch service, which is a host of "vision.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ProductSearch scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

GrpcClient

public virtual ProductSearch.ProductSearchClient GrpcClient { get; }

The underlying gRPC ProductSearch client

Property Value
TypeDescription
ProductSearch.ProductSearchClient

ImportProductSetsOperationsClient

public virtual OperationsClient ImportProductSetsOperationsClient { get; }

The long-running operations client for ImportProductSets.

Property Value
TypeDescription
OperationsClient

PurgeProductsOperationsClient

public virtual OperationsClient PurgeProductsOperationsClient { get; }

The long-running operations client for PurgeProducts.

Property Value
TypeDescription
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

AddProductToProductSet(AddProductToProductSetRequest, CallSettings)

public virtual void AddProductToProductSet(AddProductToProductSetRequest request, CallSettings callSettings = null)

Adds a Product to the specified ProductSet. If the Product is already present, no change is made.

One Product can be added to at most 100 ProductSets.

Possible errors:

  • Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
Parameters
NameDescription
requestAddProductToProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
AddProductToProductSetRequest request = new AddProductToProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
    ProductAsProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
productSearchClient.AddProductToProductSet(request);

AddProductToProductSet(ProductSetName, ProductName, CallSettings)

public virtual void AddProductToProductSet(ProductSetName name, ProductName product, CallSettings callSettings = null)

Adds a Product to the specified ProductSet. If the Product is already present, no change is made.

One Product can be added to at most 100 ProductSets.

Possible errors:

  • Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
Parameters
NameDescription
nameProductSetName

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productProductName

Required. The resource name for the Product to be added to this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
ProductName product = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
productSearchClient.AddProductToProductSet(name, product);

AddProductToProductSet(String, String, CallSettings)

public virtual void AddProductToProductSet(string name, string product, CallSettings callSettings = null)

Adds a Product to the specified ProductSet. If the Product is already present, no change is made.

One Product can be added to at most 100 ProductSets.

Possible errors:

  • Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
Parameters
NameDescription
nameString

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productString

Required. The resource name for the Product to be added to this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
string product = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
productSearchClient.AddProductToProductSet(name, product);

AddProductToProductSetAsync(AddProductToProductSetRequest, CallSettings)

public virtual Task AddProductToProductSetAsync(AddProductToProductSetRequest request, CallSettings callSettings = null)

Adds a Product to the specified ProductSet. If the Product is already present, no change is made.

One Product can be added to at most 100 ProductSets.

Possible errors:

  • Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
Parameters
NameDescription
requestAddProductToProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
AddProductToProductSetRequest request = new AddProductToProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
    ProductAsProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
await productSearchClient.AddProductToProductSetAsync(request);

AddProductToProductSetAsync(AddProductToProductSetRequest, CancellationToken)

public virtual Task AddProductToProductSetAsync(AddProductToProductSetRequest request, CancellationToken cancellationToken)

Adds a Product to the specified ProductSet. If the Product is already present, no change is made.

One Product can be added to at most 100 ProductSets.

Possible errors:

  • Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
Parameters
NameDescription
requestAddProductToProductSetRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
AddProductToProductSetRequest request = new AddProductToProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
    ProductAsProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
await productSearchClient.AddProductToProductSetAsync(request);

AddProductToProductSetAsync(ProductSetName, ProductName, CallSettings)

public virtual Task AddProductToProductSetAsync(ProductSetName name, ProductName product, CallSettings callSettings = null)

Adds a Product to the specified ProductSet. If the Product is already present, no change is made.

One Product can be added to at most 100 ProductSets.

Possible errors:

  • Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
Parameters
NameDescription
nameProductSetName

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productProductName

Required. The resource name for the Product to be added to this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
ProductName product = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
await productSearchClient.AddProductToProductSetAsync(name, product);

AddProductToProductSetAsync(ProductSetName, ProductName, CancellationToken)

public virtual Task AddProductToProductSetAsync(ProductSetName name, ProductName product, CancellationToken cancellationToken)

Adds a Product to the specified ProductSet. If the Product is already present, no change is made.

One Product can be added to at most 100 ProductSets.

Possible errors:

  • Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
Parameters
NameDescription
nameProductSetName

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productProductName

Required. The resource name for the Product to be added to this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
ProductName product = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
await productSearchClient.AddProductToProductSetAsync(name, product);

AddProductToProductSetAsync(String, String, CallSettings)

public virtual Task AddProductToProductSetAsync(string name, string product, CallSettings callSettings = null)

Adds a Product to the specified ProductSet. If the Product is already present, no change is made.

One Product can be added to at most 100 ProductSets.

Possible errors:

  • Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
Parameters
NameDescription
nameString

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productString

Required. The resource name for the Product to be added to this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
string product = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
await productSearchClient.AddProductToProductSetAsync(name, product);

AddProductToProductSetAsync(String, String, CancellationToken)

public virtual Task AddProductToProductSetAsync(string name, string product, CancellationToken cancellationToken)

Adds a Product to the specified ProductSet. If the Product is already present, no change is made.

One Product can be added to at most 100 ProductSets.

Possible errors:

  • Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
Parameters
NameDescription
nameString

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productString

Required. The resource name for the Product to be added to this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
string product = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
await productSearchClient.AddProductToProductSetAsync(name, product);

Create()

public static ProductSearchClient Create()

Synchronously creates a ProductSearchClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ProductSearchClientBuilder.

Returns
TypeDescription
ProductSearchClient

The created ProductSearchClient.

CreateAsync(CancellationToken)

public static Task<ProductSearchClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<ProductSearchClient>

The task representing the created ProductSearchClient.

CreateProduct(LocationName, Product, String, CallSettings)

public virtual Product CreateProduct(LocationName parent, Product product, string productId, CallSettings callSettings = null)

Creates and returns a new product resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is missing or invalid.
Parameters
NameDescription
parentLocationName

Required. The project in which the Product should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productProduct

Required. The product to create.

productIdString

A user-supplied resource id for this Product. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Product

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Product product = new Product();
string productId = "";
// Make the request
Product response = productSearchClient.CreateProduct(parent, product, productId);

CreateProduct(CreateProductRequest, CallSettings)

public virtual Product CreateProduct(CreateProductRequest request, CallSettings callSettings = null)

Creates and returns a new product resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is missing or invalid.
Parameters
NameDescription
requestCreateProductRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Product

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
CreateProductRequest request = new CreateProductRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Product = new Product(),
    ProductId = "",
};
// Make the request
Product response = productSearchClient.CreateProduct(request);

CreateProduct(String, Product, String, CallSettings)

public virtual Product CreateProduct(string parent, Product product, string productId, CallSettings callSettings = null)

Creates and returns a new product resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is missing or invalid.
Parameters
NameDescription
parentString

Required. The project in which the Product should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productProduct

Required. The product to create.

productIdString

A user-supplied resource id for this Product. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Product

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Product product = new Product();
string productId = "";
// Make the request
Product response = productSearchClient.CreateProduct(parent, product, productId);

CreateProductAsync(LocationName, Product, String, CallSettings)

public virtual Task<Product> CreateProductAsync(LocationName parent, Product product, string productId, CallSettings callSettings = null)

Creates and returns a new product resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is missing or invalid.
Parameters
NameDescription
parentLocationName

Required. The project in which the Product should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productProduct

Required. The product to create.

productIdString

A user-supplied resource id for this Product. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Product product = new Product();
string productId = "";
// Make the request
Product response = await productSearchClient.CreateProductAsync(parent, product, productId);

CreateProductAsync(LocationName, Product, String, CancellationToken)

public virtual Task<Product> CreateProductAsync(LocationName parent, Product product, string productId, CancellationToken cancellationToken)

Creates and returns a new product resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is missing or invalid.
Parameters
NameDescription
parentLocationName

Required. The project in which the Product should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productProduct

Required. The product to create.

productIdString

A user-supplied resource id for this Product. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Product product = new Product();
string productId = "";
// Make the request
Product response = await productSearchClient.CreateProductAsync(parent, product, productId);

CreateProductAsync(CreateProductRequest, CallSettings)

public virtual Task<Product> CreateProductAsync(CreateProductRequest request, CallSettings callSettings = null)

Creates and returns a new product resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is missing or invalid.
Parameters
NameDescription
requestCreateProductRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
CreateProductRequest request = new CreateProductRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Product = new Product(),
    ProductId = "",
};
// Make the request
Product response = await productSearchClient.CreateProductAsync(request);

CreateProductAsync(CreateProductRequest, CancellationToken)

public virtual Task<Product> CreateProductAsync(CreateProductRequest request, CancellationToken cancellationToken)

Creates and returns a new product resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is missing or invalid.
Parameters
NameDescription
requestCreateProductRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
CreateProductRequest request = new CreateProductRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Product = new Product(),
    ProductId = "",
};
// Make the request
Product response = await productSearchClient.CreateProductAsync(request);

CreateProductAsync(String, Product, String, CallSettings)

public virtual Task<Product> CreateProductAsync(string parent, Product product, string productId, CallSettings callSettings = null)

Creates and returns a new product resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is missing or invalid.
Parameters
NameDescription
parentString

Required. The project in which the Product should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productProduct

Required. The product to create.

productIdString

A user-supplied resource id for this Product. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Product product = new Product();
string productId = "";
// Make the request
Product response = await productSearchClient.CreateProductAsync(parent, product, productId);

CreateProductAsync(String, Product, String, CancellationToken)

public virtual Task<Product> CreateProductAsync(string parent, Product product, string productId, CancellationToken cancellationToken)

Creates and returns a new product resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is missing or invalid.
Parameters
NameDescription
parentString

Required. The project in which the Product should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productProduct

Required. The product to create.

productIdString

A user-supplied resource id for this Product. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Product product = new Product();
string productId = "";
// Make the request
Product response = await productSearchClient.CreateProductAsync(parent, product, productId);

CreateProductSet(LocationName, ProductSet, String, CallSettings)

public virtual ProductSet CreateProductSet(LocationName parent, ProductSet productSet, string productSetId, CallSettings callSettings = null)

Creates and returns a new ProductSet resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters
NameDescription
parentLocationName

Required. The project in which the ProductSet should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productSetProductSet

Required. The ProductSet to create.

productSetIdString

A user-supplied resource id for this ProductSet. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProductSet

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
ProductSet productSet = new ProductSet();
string productSetId = "";
// Make the request
ProductSet response = productSearchClient.CreateProductSet(parent, productSet, productSetId);

CreateProductSet(CreateProductSetRequest, CallSettings)

public virtual ProductSet CreateProductSet(CreateProductSetRequest request, CallSettings callSettings = null)

Creates and returns a new ProductSet resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters
NameDescription
requestCreateProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProductSet

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
CreateProductSetRequest request = new CreateProductSetRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ProductSet = new ProductSet(),
    ProductSetId = "",
};
// Make the request
ProductSet response = productSearchClient.CreateProductSet(request);

CreateProductSet(String, ProductSet, String, CallSettings)

public virtual ProductSet CreateProductSet(string parent, ProductSet productSet, string productSetId, CallSettings callSettings = null)

Creates and returns a new ProductSet resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters
NameDescription
parentString

Required. The project in which the ProductSet should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productSetProductSet

Required. The ProductSet to create.

productSetIdString

A user-supplied resource id for this ProductSet. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProductSet

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
ProductSet productSet = new ProductSet();
string productSetId = "";
// Make the request
ProductSet response = productSearchClient.CreateProductSet(parent, productSet, productSetId);

CreateProductSetAsync(LocationName, ProductSet, String, CallSettings)

public virtual Task<ProductSet> CreateProductSetAsync(LocationName parent, ProductSet productSet, string productSetId, CallSettings callSettings = null)

Creates and returns a new ProductSet resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters
NameDescription
parentLocationName

Required. The project in which the ProductSet should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productSetProductSet

Required. The ProductSet to create.

productSetIdString

A user-supplied resource id for this ProductSet. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
ProductSet productSet = new ProductSet();
string productSetId = "";
// Make the request
ProductSet response = await productSearchClient.CreateProductSetAsync(parent, productSet, productSetId);

CreateProductSetAsync(LocationName, ProductSet, String, CancellationToken)

public virtual Task<ProductSet> CreateProductSetAsync(LocationName parent, ProductSet productSet, string productSetId, CancellationToken cancellationToken)

Creates and returns a new ProductSet resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters
NameDescription
parentLocationName

Required. The project in which the ProductSet should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productSetProductSet

Required. The ProductSet to create.

productSetIdString

A user-supplied resource id for this ProductSet. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
ProductSet productSet = new ProductSet();
string productSetId = "";
// Make the request
ProductSet response = await productSearchClient.CreateProductSetAsync(parent, productSet, productSetId);

CreateProductSetAsync(CreateProductSetRequest, CallSettings)

public virtual Task<ProductSet> CreateProductSetAsync(CreateProductSetRequest request, CallSettings callSettings = null)

Creates and returns a new ProductSet resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters
NameDescription
requestCreateProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
CreateProductSetRequest request = new CreateProductSetRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ProductSet = new ProductSet(),
    ProductSetId = "",
};
// Make the request
ProductSet response = await productSearchClient.CreateProductSetAsync(request);

CreateProductSetAsync(CreateProductSetRequest, CancellationToken)

public virtual Task<ProductSet> CreateProductSetAsync(CreateProductSetRequest request, CancellationToken cancellationToken)

Creates and returns a new ProductSet resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters
NameDescription
requestCreateProductSetRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
CreateProductSetRequest request = new CreateProductSetRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ProductSet = new ProductSet(),
    ProductSetId = "",
};
// Make the request
ProductSet response = await productSearchClient.CreateProductSetAsync(request);

CreateProductSetAsync(String, ProductSet, String, CallSettings)

public virtual Task<ProductSet> CreateProductSetAsync(string parent, ProductSet productSet, string productSetId, CallSettings callSettings = null)

Creates and returns a new ProductSet resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters
NameDescription
parentString

Required. The project in which the ProductSet should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productSetProductSet

Required. The ProductSet to create.

productSetIdString

A user-supplied resource id for this ProductSet. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
ProductSet productSet = new ProductSet();
string productSetId = "";
// Make the request
ProductSet response = await productSearchClient.CreateProductSetAsync(parent, productSet, productSetId);

CreateProductSetAsync(String, ProductSet, String, CancellationToken)

public virtual Task<ProductSet> CreateProductSetAsync(string parent, ProductSet productSet, string productSetId, CancellationToken cancellationToken)

Creates and returns a new ProductSet resource.

Possible errors:

  • Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
Parameters
NameDescription
parentString

Required. The project in which the ProductSet should be created.

Format is projects/PROJECT_ID/locations/LOC_ID.

productSetProductSet

Required. The ProductSet to create.

productSetIdString

A user-supplied resource id for this ProductSet. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
ProductSet productSet = new ProductSet();
string productSetId = "";
// Make the request
ProductSet response = await productSearchClient.CreateProductSetAsync(parent, productSet, productSetId);

CreateReferenceImage(CreateReferenceImageRequest, CallSettings)

public virtual ReferenceImage CreateReferenceImage(CreateReferenceImageRequest request, CallSettings callSettings = null)

Creates and returns a new ReferenceImage resource.

The bounding_poly field is optional. If bounding_poly is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles.

Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP).

Possible errors:

  • Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if the product does not exist.
  • Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected.
  • Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
Parameters
NameDescription
requestCreateReferenceImageRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReferenceImage

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
CreateReferenceImageRequest request = new CreateReferenceImageRequest
{
    ParentAsProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
    ReferenceImage = new ReferenceImage(),
    ReferenceImageId = "",
};
// Make the request
ReferenceImage response = productSearchClient.CreateReferenceImage(request);

CreateReferenceImage(ProductName, ReferenceImage, String, CallSettings)

public virtual ReferenceImage CreateReferenceImage(ProductName parent, ReferenceImage referenceImage, string referenceImageId, CallSettings callSettings = null)

Creates and returns a new ReferenceImage resource.

The bounding_poly field is optional. If bounding_poly is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles.

Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP).

Possible errors:

  • Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if the product does not exist.
  • Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected.
  • Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
Parameters
NameDescription
parentProductName

Required. Resource name of the product in which to create the reference image.

Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

referenceImageReferenceImage

Required. The reference image to create. If an image ID is specified, it is ignored.

referenceImageIdString

A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReferenceImage

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ProductName parent = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
ReferenceImage referenceImage = new ReferenceImage();
string referenceImageId = "";
// Make the request
ReferenceImage response = productSearchClient.CreateReferenceImage(parent, referenceImage, referenceImageId);

CreateReferenceImage(String, ReferenceImage, String, CallSettings)

public virtual ReferenceImage CreateReferenceImage(string parent, ReferenceImage referenceImage, string referenceImageId, CallSettings callSettings = null)

Creates and returns a new ReferenceImage resource.

The bounding_poly field is optional. If bounding_poly is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles.

Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP).

Possible errors:

  • Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if the product does not exist.
  • Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected.
  • Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
Parameters
NameDescription
parentString

Required. Resource name of the product in which to create the reference image.

Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

referenceImageReferenceImage

Required. The reference image to create. If an image ID is specified, it is ignored.

referenceImageIdString

A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReferenceImage

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
ReferenceImage referenceImage = new ReferenceImage();
string referenceImageId = "";
// Make the request
ReferenceImage response = productSearchClient.CreateReferenceImage(parent, referenceImage, referenceImageId);

CreateReferenceImageAsync(CreateReferenceImageRequest, CallSettings)

public virtual Task<ReferenceImage> CreateReferenceImageAsync(CreateReferenceImageRequest request, CallSettings callSettings = null)

Creates and returns a new ReferenceImage resource.

The bounding_poly field is optional. If bounding_poly is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles.

Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP).

Possible errors:

  • Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if the product does not exist.
  • Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected.
  • Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
Parameters
NameDescription
requestCreateReferenceImageRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
CreateReferenceImageRequest request = new CreateReferenceImageRequest
{
    ParentAsProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
    ReferenceImage = new ReferenceImage(),
    ReferenceImageId = "",
};
// Make the request
ReferenceImage response = await productSearchClient.CreateReferenceImageAsync(request);

CreateReferenceImageAsync(CreateReferenceImageRequest, CancellationToken)

public virtual Task<ReferenceImage> CreateReferenceImageAsync(CreateReferenceImageRequest request, CancellationToken cancellationToken)

Creates and returns a new ReferenceImage resource.

The bounding_poly field is optional. If bounding_poly is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles.

Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP).

Possible errors:

  • Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if the product does not exist.
  • Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected.
  • Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
Parameters
NameDescription
requestCreateReferenceImageRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
CreateReferenceImageRequest request = new CreateReferenceImageRequest
{
    ParentAsProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
    ReferenceImage = new ReferenceImage(),
    ReferenceImageId = "",
};
// Make the request
ReferenceImage response = await productSearchClient.CreateReferenceImageAsync(request);

CreateReferenceImageAsync(ProductName, ReferenceImage, String, CallSettings)

public virtual Task<ReferenceImage> CreateReferenceImageAsync(ProductName parent, ReferenceImage referenceImage, string referenceImageId, CallSettings callSettings = null)

Creates and returns a new ReferenceImage resource.

The bounding_poly field is optional. If bounding_poly is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles.

Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP).

Possible errors:

  • Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if the product does not exist.
  • Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected.
  • Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
Parameters
NameDescription
parentProductName

Required. Resource name of the product in which to create the reference image.

Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

referenceImageReferenceImage

Required. The reference image to create. If an image ID is specified, it is ignored.

referenceImageIdString

A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductName parent = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
ReferenceImage referenceImage = new ReferenceImage();
string referenceImageId = "";
// Make the request
ReferenceImage response = await productSearchClient.CreateReferenceImageAsync(parent, referenceImage, referenceImageId);

CreateReferenceImageAsync(ProductName, ReferenceImage, String, CancellationToken)

public virtual Task<ReferenceImage> CreateReferenceImageAsync(ProductName parent, ReferenceImage referenceImage, string referenceImageId, CancellationToken cancellationToken)

Creates and returns a new ReferenceImage resource.

The bounding_poly field is optional. If bounding_poly is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles.

Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP).

Possible errors:

  • Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if the product does not exist.
  • Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected.
  • Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
Parameters
NameDescription
parentProductName

Required. Resource name of the product in which to create the reference image.

Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

referenceImageReferenceImage

Required. The reference image to create. If an image ID is specified, it is ignored.

referenceImageIdString

A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductName parent = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
ReferenceImage referenceImage = new ReferenceImage();
string referenceImageId = "";
// Make the request
ReferenceImage response = await productSearchClient.CreateReferenceImageAsync(parent, referenceImage, referenceImageId);

CreateReferenceImageAsync(String, ReferenceImage, String, CallSettings)

public virtual Task<ReferenceImage> CreateReferenceImageAsync(string parent, ReferenceImage referenceImage, string referenceImageId, CallSettings callSettings = null)

Creates and returns a new ReferenceImage resource.

The bounding_poly field is optional. If bounding_poly is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles.

Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP).

Possible errors:

  • Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if the product does not exist.
  • Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected.
  • Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
Parameters
NameDescription
parentString

Required. Resource name of the product in which to create the reference image.

Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

referenceImageReferenceImage

Required. The reference image to create. If an image ID is specified, it is ignored.

referenceImageIdString

A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
ReferenceImage referenceImage = new ReferenceImage();
string referenceImageId = "";
// Make the request
ReferenceImage response = await productSearchClient.CreateReferenceImageAsync(parent, referenceImage, referenceImageId);

CreateReferenceImageAsync(String, ReferenceImage, String, CancellationToken)

public virtual Task<ReferenceImage> CreateReferenceImageAsync(string parent, ReferenceImage referenceImage, string referenceImageId, CancellationToken cancellationToken)

Creates and returns a new ReferenceImage resource.

The bounding_poly field is optional. If bounding_poly is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles.

Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP).

Possible errors:

  • Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if the product does not exist.
  • Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected.
  • Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
Parameters
NameDescription
parentString

Required. Resource name of the product in which to create the reference image.

Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

referenceImageReferenceImage

Required. The reference image to create. If an image ID is specified, it is ignored.

referenceImageIdString

A user-supplied resource id for the ReferenceImage to be added. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
ReferenceImage referenceImage = new ReferenceImage();
string referenceImageId = "";
// Make the request
ReferenceImage response = await productSearchClient.CreateReferenceImageAsync(parent, referenceImage, referenceImageId);

DeleteProduct(DeleteProductRequest, CallSettings)

public virtual void DeleteProduct(DeleteProductRequest request, CallSettings callSettings = null)

Permanently deletes a product and its reference images.

Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

Parameters
NameDescription
requestDeleteProductRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
DeleteProductRequest request = new DeleteProductRequest
{
    ProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
productSearchClient.DeleteProduct(request);

DeleteProduct(ProductName, CallSettings)

public virtual void DeleteProduct(ProductName name, CallSettings callSettings = null)

Permanently deletes a product and its reference images.

Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

Parameters
NameDescription
nameProductName

Required. Resource name of product to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
productSearchClient.DeleteProduct(name);

DeleteProduct(String, CallSettings)

public virtual void DeleteProduct(string name, CallSettings callSettings = null)

Permanently deletes a product and its reference images.

Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

Parameters
NameDescription
nameString

Required. Resource name of product to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
productSearchClient.DeleteProduct(name);

DeleteProductAsync(DeleteProductRequest, CallSettings)

public virtual Task DeleteProductAsync(DeleteProductRequest request, CallSettings callSettings = null)

Permanently deletes a product and its reference images.

Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

Parameters
NameDescription
requestDeleteProductRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
DeleteProductRequest request = new DeleteProductRequest
{
    ProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
await productSearchClient.DeleteProductAsync(request);

DeleteProductAsync(DeleteProductRequest, CancellationToken)

public virtual Task DeleteProductAsync(DeleteProductRequest request, CancellationToken cancellationToken)

Permanently deletes a product and its reference images.

Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

Parameters
NameDescription
requestDeleteProductRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
DeleteProductRequest request = new DeleteProductRequest
{
    ProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
await productSearchClient.DeleteProductAsync(request);

DeleteProductAsync(ProductName, CallSettings)

public virtual Task DeleteProductAsync(ProductName name, CallSettings callSettings = null)

Permanently deletes a product and its reference images.

Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

Parameters
NameDescription
nameProductName

Required. Resource name of product to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
await productSearchClient.DeleteProductAsync(name);

DeleteProductAsync(ProductName, CancellationToken)

public virtual Task DeleteProductAsync(ProductName name, CancellationToken cancellationToken)

Permanently deletes a product and its reference images.

Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

Parameters
NameDescription
nameProductName

Required. Resource name of product to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
await productSearchClient.DeleteProductAsync(name);

DeleteProductAsync(String, CallSettings)

public virtual Task DeleteProductAsync(string name, CallSettings callSettings = null)

Permanently deletes a product and its reference images.

Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

Parameters
NameDescription
nameString

Required. Resource name of product to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
await productSearchClient.DeleteProductAsync(name);

DeleteProductAsync(String, CancellationToken)

public virtual Task DeleteProductAsync(string name, CancellationToken cancellationToken)

Permanently deletes a product and its reference images.

Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

Parameters
NameDescription
nameString

Required. Resource name of product to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
await productSearchClient.DeleteProductAsync(name);

DeleteProductSet(DeleteProductSetRequest, CallSettings)

public virtual void DeleteProductSet(DeleteProductSetRequest request, CallSettings callSettings = null)

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
requestDeleteProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
DeleteProductSetRequest request = new DeleteProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
};
// Make the request
productSearchClient.DeleteProductSet(request);

DeleteProductSet(ProductSetName, CallSettings)

public virtual void DeleteProductSet(ProductSetName name, CallSettings callSettings = null)

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameProductSetName

Required. Resource name of the ProductSet to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
// Make the request
productSearchClient.DeleteProductSet(name);

DeleteProductSet(String, CallSettings)

public virtual void DeleteProductSet(string name, CallSettings callSettings = null)

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameString

Required. Resource name of the ProductSet to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
// Make the request
productSearchClient.DeleteProductSet(name);

DeleteProductSetAsync(DeleteProductSetRequest, CallSettings)

public virtual Task DeleteProductSetAsync(DeleteProductSetRequest request, CallSettings callSettings = null)

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
requestDeleteProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
DeleteProductSetRequest request = new DeleteProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
};
// Make the request
await productSearchClient.DeleteProductSetAsync(request);

DeleteProductSetAsync(DeleteProductSetRequest, CancellationToken)

public virtual Task DeleteProductSetAsync(DeleteProductSetRequest request, CancellationToken cancellationToken)

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
requestDeleteProductSetRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
DeleteProductSetRequest request = new DeleteProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
};
// Make the request
await productSearchClient.DeleteProductSetAsync(request);

DeleteProductSetAsync(ProductSetName, CallSettings)

public virtual Task DeleteProductSetAsync(ProductSetName name, CallSettings callSettings = null)

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameProductSetName

Required. Resource name of the ProductSet to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
// Make the request
await productSearchClient.DeleteProductSetAsync(name);

DeleteProductSetAsync(ProductSetName, CancellationToken)

public virtual Task DeleteProductSetAsync(ProductSetName name, CancellationToken cancellationToken)

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameProductSetName

Required. Resource name of the ProductSet to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
// Make the request
await productSearchClient.DeleteProductSetAsync(name);

DeleteProductSetAsync(String, CallSettings)

public virtual Task DeleteProductSetAsync(string name, CallSettings callSettings = null)

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameString

Required. Resource name of the ProductSet to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
// Make the request
await productSearchClient.DeleteProductSetAsync(name);

DeleteProductSetAsync(String, CancellationToken)

public virtual Task DeleteProductSetAsync(string name, CancellationToken cancellationToken)

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameString

Required. Resource name of the ProductSet to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
// Make the request
await productSearchClient.DeleteProductSetAsync(name);

DeleteReferenceImage(DeleteReferenceImageRequest, CallSettings)

public virtual void DeleteReferenceImage(DeleteReferenceImageRequest request, CallSettings callSettings = null)

Permanently deletes a reference image.

The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
requestDeleteReferenceImageRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
DeleteReferenceImageRequest request = new DeleteReferenceImageRequest
{
    ReferenceImageName = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]"),
};
// Make the request
productSearchClient.DeleteReferenceImage(request);

DeleteReferenceImage(ReferenceImageName, CallSettings)

public virtual void DeleteReferenceImage(ReferenceImageName name, CallSettings callSettings = null)

Permanently deletes a reference image.

The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameReferenceImageName

Required. The resource name of the reference image to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ReferenceImageName name = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
// Make the request
productSearchClient.DeleteReferenceImage(name);

DeleteReferenceImage(String, CallSettings)

public virtual void DeleteReferenceImage(string name, CallSettings callSettings = null)

Permanently deletes a reference image.

The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameString

Required. The resource name of the reference image to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]/referenceImages/[REFERENCE_IMAGE]";
// Make the request
productSearchClient.DeleteReferenceImage(name);

DeleteReferenceImageAsync(DeleteReferenceImageRequest, CallSettings)

public virtual Task DeleteReferenceImageAsync(DeleteReferenceImageRequest request, CallSettings callSettings = null)

Permanently deletes a reference image.

The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
requestDeleteReferenceImageRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
DeleteReferenceImageRequest request = new DeleteReferenceImageRequest
{
    ReferenceImageName = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]"),
};
// Make the request
await productSearchClient.DeleteReferenceImageAsync(request);

DeleteReferenceImageAsync(DeleteReferenceImageRequest, CancellationToken)

public virtual Task DeleteReferenceImageAsync(DeleteReferenceImageRequest request, CancellationToken cancellationToken)

Permanently deletes a reference image.

The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
requestDeleteReferenceImageRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
DeleteReferenceImageRequest request = new DeleteReferenceImageRequest
{
    ReferenceImageName = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]"),
};
// Make the request
await productSearchClient.DeleteReferenceImageAsync(request);

DeleteReferenceImageAsync(ReferenceImageName, CallSettings)

public virtual Task DeleteReferenceImageAsync(ReferenceImageName name, CallSettings callSettings = null)

Permanently deletes a reference image.

The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameReferenceImageName

Required. The resource name of the reference image to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ReferenceImageName name = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
// Make the request
await productSearchClient.DeleteReferenceImageAsync(name);

DeleteReferenceImageAsync(ReferenceImageName, CancellationToken)

public virtual Task DeleteReferenceImageAsync(ReferenceImageName name, CancellationToken cancellationToken)

Permanently deletes a reference image.

The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameReferenceImageName

Required. The resource name of the reference image to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ReferenceImageName name = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
// Make the request
await productSearchClient.DeleteReferenceImageAsync(name);

DeleteReferenceImageAsync(String, CallSettings)

public virtual Task DeleteReferenceImageAsync(string name, CallSettings callSettings = null)

Permanently deletes a reference image.

The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameString

Required. The resource name of the reference image to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]/referenceImages/[REFERENCE_IMAGE]";
// Make the request
await productSearchClient.DeleteReferenceImageAsync(name);

DeleteReferenceImageAsync(String, CancellationToken)

public virtual Task DeleteReferenceImageAsync(string name, CancellationToken cancellationToken)

Permanently deletes a reference image.

The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed.

The actual image files are not deleted from Google Cloud Storage.

Parameters
NameDescription
nameString

Required. The resource name of the reference image to delete.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]/referenceImages/[REFERENCE_IMAGE]";
// Make the request
await productSearchClient.DeleteReferenceImageAsync(name);

GetProduct(GetProductRequest, CallSettings)

public virtual Product GetProduct(GetProductRequest request, CallSettings callSettings = null)

Gets information associated with a Product.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
Parameters
NameDescription
requestGetProductRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Product

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
GetProductRequest request = new GetProductRequest
{
    ProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
Product response = productSearchClient.GetProduct(request);

GetProduct(ProductName, CallSettings)

public virtual Product GetProduct(ProductName name, CallSettings callSettings = null)

Gets information associated with a Product.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
Parameters
NameDescription
nameProductName

Required. Resource name of the Product to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Product

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
Product response = productSearchClient.GetProduct(name);

GetProduct(String, CallSettings)

public virtual Product GetProduct(string name, CallSettings callSettings = null)

Gets information associated with a Product.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
Parameters
NameDescription
nameString

Required. Resource name of the Product to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Product

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
Product response = productSearchClient.GetProduct(name);

GetProductAsync(GetProductRequest, CallSettings)

public virtual Task<Product> GetProductAsync(GetProductRequest request, CallSettings callSettings = null)

Gets information associated with a Product.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
Parameters
NameDescription
requestGetProductRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
GetProductRequest request = new GetProductRequest
{
    ProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
Product response = await productSearchClient.GetProductAsync(request);

GetProductAsync(GetProductRequest, CancellationToken)

public virtual Task<Product> GetProductAsync(GetProductRequest request, CancellationToken cancellationToken)

Gets information associated with a Product.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
Parameters
NameDescription
requestGetProductRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
GetProductRequest request = new GetProductRequest
{
    ProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
Product response = await productSearchClient.GetProductAsync(request);

GetProductAsync(ProductName, CallSettings)

public virtual Task<Product> GetProductAsync(ProductName name, CallSettings callSettings = null)

Gets information associated with a Product.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
Parameters
NameDescription
nameProductName

Required. Resource name of the Product to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
Product response = await productSearchClient.GetProductAsync(name);

GetProductAsync(ProductName, CancellationToken)

public virtual Task<Product> GetProductAsync(ProductName name, CancellationToken cancellationToken)

Gets information associated with a Product.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
Parameters
NameDescription
nameProductName

Required. Resource name of the Product to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
Product response = await productSearchClient.GetProductAsync(name);

GetProductAsync(String, CallSettings)

public virtual Task<Product> GetProductAsync(string name, CallSettings callSettings = null)

Gets information associated with a Product.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
Parameters
NameDescription
nameString

Required. Resource name of the Product to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
Product response = await productSearchClient.GetProductAsync(name);

GetProductAsync(String, CancellationToken)

public virtual Task<Product> GetProductAsync(string name, CancellationToken cancellationToken)

Gets information associated with a Product.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
Parameters
NameDescription
nameString

Required. Resource name of the Product to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
Product response = await productSearchClient.GetProductAsync(name);

GetProductSet(GetProductSetRequest, CallSettings)

public virtual ProductSet GetProductSet(GetProductSetRequest request, CallSettings callSettings = null)

Gets information associated with a ProductSet.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
Parameters
NameDescription
requestGetProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProductSet

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
GetProductSetRequest request = new GetProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
};
// Make the request
ProductSet response = productSearchClient.GetProductSet(request);

GetProductSet(ProductSetName, CallSettings)

public virtual ProductSet GetProductSet(ProductSetName name, CallSettings callSettings = null)

Gets information associated with a ProductSet.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
Parameters
NameDescription
nameProductSetName

Required. Resource name of the ProductSet to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProductSet

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
// Make the request
ProductSet response = productSearchClient.GetProductSet(name);

GetProductSet(String, CallSettings)

public virtual ProductSet GetProductSet(string name, CallSettings callSettings = null)

Gets information associated with a ProductSet.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
Parameters
NameDescription
nameString

Required. Resource name of the ProductSet to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProductSet

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
// Make the request
ProductSet response = productSearchClient.GetProductSet(name);

GetProductSetAsync(GetProductSetRequest, CallSettings)

public virtual Task<ProductSet> GetProductSetAsync(GetProductSetRequest request, CallSettings callSettings = null)

Gets information associated with a ProductSet.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
Parameters
NameDescription
requestGetProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
GetProductSetRequest request = new GetProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
};
// Make the request
ProductSet response = await productSearchClient.GetProductSetAsync(request);

GetProductSetAsync(GetProductSetRequest, CancellationToken)

public virtual Task<ProductSet> GetProductSetAsync(GetProductSetRequest request, CancellationToken cancellationToken)

Gets information associated with a ProductSet.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
Parameters
NameDescription
requestGetProductSetRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
GetProductSetRequest request = new GetProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
};
// Make the request
ProductSet response = await productSearchClient.GetProductSetAsync(request);

GetProductSetAsync(ProductSetName, CallSettings)

public virtual Task<ProductSet> GetProductSetAsync(ProductSetName name, CallSettings callSettings = null)

Gets information associated with a ProductSet.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
Parameters
NameDescription
nameProductSetName

Required. Resource name of the ProductSet to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
// Make the request
ProductSet response = await productSearchClient.GetProductSetAsync(name);

GetProductSetAsync(ProductSetName, CancellationToken)

public virtual Task<ProductSet> GetProductSetAsync(ProductSetName name, CancellationToken cancellationToken)

Gets information associated with a ProductSet.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
Parameters
NameDescription
nameProductSetName

Required. Resource name of the ProductSet to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
// Make the request
ProductSet response = await productSearchClient.GetProductSetAsync(name);

GetProductSetAsync(String, CallSettings)

public virtual Task<ProductSet> GetProductSetAsync(string name, CallSettings callSettings = null)

Gets information associated with a ProductSet.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
Parameters
NameDescription
nameString

Required. Resource name of the ProductSet to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
// Make the request
ProductSet response = await productSearchClient.GetProductSetAsync(name);

GetProductSetAsync(String, CancellationToken)

public virtual Task<ProductSet> GetProductSetAsync(string name, CancellationToken cancellationToken)

Gets information associated with a ProductSet.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
Parameters
NameDescription
nameString

Required. Resource name of the ProductSet to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
// Make the request
ProductSet response = await productSearchClient.GetProductSetAsync(name);

GetReferenceImage(GetReferenceImageRequest, CallSettings)

public virtual ReferenceImage GetReferenceImage(GetReferenceImageRequest request, CallSettings callSettings = null)

Gets information associated with a ReferenceImage.

Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.
Parameters
NameDescription
requestGetReferenceImageRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReferenceImage

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
GetReferenceImageRequest request = new GetReferenceImageRequest
{
    ReferenceImageName = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]"),
};
// Make the request
ReferenceImage response = productSearchClient.GetReferenceImage(request);

GetReferenceImage(ReferenceImageName, CallSettings)

public virtual ReferenceImage GetReferenceImage(ReferenceImageName name, CallSettings callSettings = null)

Gets information associated with a ReferenceImage.

Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.
Parameters
NameDescription
nameReferenceImageName

Required. The resource name of the ReferenceImage to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReferenceImage

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ReferenceImageName name = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
// Make the request
ReferenceImage response = productSearchClient.GetReferenceImage(name);

GetReferenceImage(String, CallSettings)

public virtual ReferenceImage GetReferenceImage(string name, CallSettings callSettings = null)

Gets information associated with a ReferenceImage.

Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.
Parameters
NameDescription
nameString

Required. The resource name of the ReferenceImage to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ReferenceImage

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]/referenceImages/[REFERENCE_IMAGE]";
// Make the request
ReferenceImage response = productSearchClient.GetReferenceImage(name);

GetReferenceImageAsync(GetReferenceImageRequest, CallSettings)

public virtual Task<ReferenceImage> GetReferenceImageAsync(GetReferenceImageRequest request, CallSettings callSettings = null)

Gets information associated with a ReferenceImage.

Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.
Parameters
NameDescription
requestGetReferenceImageRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
GetReferenceImageRequest request = new GetReferenceImageRequest
{
    ReferenceImageName = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]"),
};
// Make the request
ReferenceImage response = await productSearchClient.GetReferenceImageAsync(request);

GetReferenceImageAsync(GetReferenceImageRequest, CancellationToken)

public virtual Task<ReferenceImage> GetReferenceImageAsync(GetReferenceImageRequest request, CancellationToken cancellationToken)

Gets information associated with a ReferenceImage.

Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.
Parameters
NameDescription
requestGetReferenceImageRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
GetReferenceImageRequest request = new GetReferenceImageRequest
{
    ReferenceImageName = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]"),
};
// Make the request
ReferenceImage response = await productSearchClient.GetReferenceImageAsync(request);

GetReferenceImageAsync(ReferenceImageName, CallSettings)

public virtual Task<ReferenceImage> GetReferenceImageAsync(ReferenceImageName name, CallSettings callSettings = null)

Gets information associated with a ReferenceImage.

Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.
Parameters
NameDescription
nameReferenceImageName

Required. The resource name of the ReferenceImage to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ReferenceImageName name = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
// Make the request
ReferenceImage response = await productSearchClient.GetReferenceImageAsync(name);

GetReferenceImageAsync(ReferenceImageName, CancellationToken)

public virtual Task<ReferenceImage> GetReferenceImageAsync(ReferenceImageName name, CancellationToken cancellationToken)

Gets information associated with a ReferenceImage.

Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.
Parameters
NameDescription
nameReferenceImageName

Required. The resource name of the ReferenceImage to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ReferenceImageName name = ReferenceImageName.FromProjectLocationProductReferenceImage("[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]");
// Make the request
ReferenceImage response = await productSearchClient.GetReferenceImageAsync(name);

GetReferenceImageAsync(String, CallSettings)

public virtual Task<ReferenceImage> GetReferenceImageAsync(string name, CallSettings callSettings = null)

Gets information associated with a ReferenceImage.

Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.
Parameters
NameDescription
nameString

Required. The resource name of the ReferenceImage to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]/referenceImages/[REFERENCE_IMAGE]";
// Make the request
ReferenceImage response = await productSearchClient.GetReferenceImageAsync(name);

GetReferenceImageAsync(String, CancellationToken)

public virtual Task<ReferenceImage> GetReferenceImageAsync(string name, CancellationToken cancellationToken)

Gets information associated with a ReferenceImage.

Possible errors:

  • Returns NOT_FOUND if the specified image does not exist.
Parameters
NameDescription
nameString

Required. The resource name of the ReferenceImage to get.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ReferenceImage>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]/referenceImages/[REFERENCE_IMAGE]";
// Make the request
ReferenceImage response = await productSearchClient.GetReferenceImageAsync(name);

ImportProductSets(LocationName, ImportProductSetsInputConfig, CallSettings)

public virtual Operation<ImportProductSetsResponse, BatchOperationMetadata> ImportProductSets(LocationName parent, ImportProductSetsInputConfig inputConfig, CallSettings callSettings = null)

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results)

The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].

Parameters
NameDescription
parentLocationName

Required. The project in which the ProductSets should be imported.

Format is projects/PROJECT_ID/locations/LOC_ID.

inputConfigImportProductSetsInputConfig

Required. The input content for the list of requests.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<ImportProductSetsResponse, BatchOperationMetadata>

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
ImportProductSetsInputConfig inputConfig = new ImportProductSetsInputConfig();
// Make the request
Operation<ImportProductSetsResponse, BatchOperationMetadata> response = productSearchClient.ImportProductSets(parent, inputConfig);

// Poll until the returned long-running operation is complete
Operation<ImportProductSetsResponse, BatchOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ImportProductSetsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductSetsResponse, BatchOperationMetadata> retrievedResponse = productSearchClient.PollOnceImportProductSets(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductSetsResponse retrievedResult = retrievedResponse.Result;
}

ImportProductSets(ImportProductSetsRequest, CallSettings)

public virtual Operation<ImportProductSetsResponse, BatchOperationMetadata> ImportProductSets(ImportProductSetsRequest request, CallSettings callSettings = null)

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results)

The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].

Parameters
NameDescription
requestImportProductSetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<ImportProductSetsResponse, BatchOperationMetadata>

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ImportProductSetsRequest request = new ImportProductSetsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    InputConfig = new ImportProductSetsInputConfig(),
};
// Make the request
Operation<ImportProductSetsResponse, BatchOperationMetadata> response = productSearchClient.ImportProductSets(request);

// Poll until the returned long-running operation is complete
Operation<ImportProductSetsResponse, BatchOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ImportProductSetsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductSetsResponse, BatchOperationMetadata> retrievedResponse = productSearchClient.PollOnceImportProductSets(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductSetsResponse retrievedResult = retrievedResponse.Result;
}

ImportProductSets(String, ImportProductSetsInputConfig, CallSettings)

public virtual Operation<ImportProductSetsResponse, BatchOperationMetadata> ImportProductSets(string parent, ImportProductSetsInputConfig inputConfig, CallSettings callSettings = null)

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results)

The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].

Parameters
NameDescription
parentString

Required. The project in which the ProductSets should be imported.

Format is projects/PROJECT_ID/locations/LOC_ID.

inputConfigImportProductSetsInputConfig

Required. The input content for the list of requests.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<ImportProductSetsResponse, BatchOperationMetadata>

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
ImportProductSetsInputConfig inputConfig = new ImportProductSetsInputConfig();
// Make the request
Operation<ImportProductSetsResponse, BatchOperationMetadata> response = productSearchClient.ImportProductSets(parent, inputConfig);

// Poll until the returned long-running operation is complete
Operation<ImportProductSetsResponse, BatchOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ImportProductSetsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductSetsResponse, BatchOperationMetadata> retrievedResponse = productSearchClient.PollOnceImportProductSets(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductSetsResponse retrievedResult = retrievedResponse.Result;
}

ImportProductSetsAsync(LocationName, ImportProductSetsInputConfig, CallSettings)

public virtual Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>> ImportProductSetsAsync(LocationName parent, ImportProductSetsInputConfig inputConfig, CallSettings callSettings = null)

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results)

The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].

Parameters
NameDescription
parentLocationName

Required. The project in which the ProductSets should be imported.

Format is projects/PROJECT_ID/locations/LOC_ID.

inputConfigImportProductSetsInputConfig

Required. The input content for the list of requests.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
ImportProductSetsInputConfig inputConfig = new ImportProductSetsInputConfig();
// Make the request
Operation<ImportProductSetsResponse, BatchOperationMetadata> response = await productSearchClient.ImportProductSetsAsync(parent, inputConfig);

// Poll until the returned long-running operation is complete
Operation<ImportProductSetsResponse, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportProductSetsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductSetsResponse, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOnceImportProductSetsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductSetsResponse retrievedResult = retrievedResponse.Result;
}

ImportProductSetsAsync(LocationName, ImportProductSetsInputConfig, CancellationToken)

public virtual Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>> ImportProductSetsAsync(LocationName parent, ImportProductSetsInputConfig inputConfig, CancellationToken cancellationToken)

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results)

The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].

Parameters
NameDescription
parentLocationName

Required. The project in which the ProductSets should be imported.

Format is projects/PROJECT_ID/locations/LOC_ID.

inputConfigImportProductSetsInputConfig

Required. The input content for the list of requests.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
ImportProductSetsInputConfig inputConfig = new ImportProductSetsInputConfig();
// Make the request
Operation<ImportProductSetsResponse, BatchOperationMetadata> response = await productSearchClient.ImportProductSetsAsync(parent, inputConfig);

// Poll until the returned long-running operation is complete
Operation<ImportProductSetsResponse, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportProductSetsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductSetsResponse, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOnceImportProductSetsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductSetsResponse retrievedResult = retrievedResponse.Result;
}

ImportProductSetsAsync(ImportProductSetsRequest, CallSettings)

public virtual Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>> ImportProductSetsAsync(ImportProductSetsRequest request, CallSettings callSettings = null)

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results)

The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].

Parameters
NameDescription
requestImportProductSetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ImportProductSetsRequest request = new ImportProductSetsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    InputConfig = new ImportProductSetsInputConfig(),
};
// Make the request
Operation<ImportProductSetsResponse, BatchOperationMetadata> response = await productSearchClient.ImportProductSetsAsync(request);

// Poll until the returned long-running operation is complete
Operation<ImportProductSetsResponse, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportProductSetsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductSetsResponse, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOnceImportProductSetsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductSetsResponse retrievedResult = retrievedResponse.Result;
}

ImportProductSetsAsync(ImportProductSetsRequest, CancellationToken)

public virtual Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>> ImportProductSetsAsync(ImportProductSetsRequest request, CancellationToken cancellationToken)

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results)

The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].

Parameters
NameDescription
requestImportProductSetsRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ImportProductSetsRequest request = new ImportProductSetsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    InputConfig = new ImportProductSetsInputConfig(),
};
// Make the request
Operation<ImportProductSetsResponse, BatchOperationMetadata> response = await productSearchClient.ImportProductSetsAsync(request);

// Poll until the returned long-running operation is complete
Operation<ImportProductSetsResponse, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportProductSetsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductSetsResponse, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOnceImportProductSetsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductSetsResponse retrievedResult = retrievedResponse.Result;
}

ImportProductSetsAsync(String, ImportProductSetsInputConfig, CallSettings)

public virtual Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>> ImportProductSetsAsync(string parent, ImportProductSetsInputConfig inputConfig, CallSettings callSettings = null)

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results)

The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].

Parameters
NameDescription
parentString

Required. The project in which the ProductSets should be imported.

Format is projects/PROJECT_ID/locations/LOC_ID.

inputConfigImportProductSetsInputConfig

Required. The input content for the list of requests.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
ImportProductSetsInputConfig inputConfig = new ImportProductSetsInputConfig();
// Make the request
Operation<ImportProductSetsResponse, BatchOperationMetadata> response = await productSearchClient.ImportProductSetsAsync(parent, inputConfig);

// Poll until the returned long-running operation is complete
Operation<ImportProductSetsResponse, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportProductSetsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductSetsResponse, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOnceImportProductSetsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductSetsResponse retrievedResult = retrievedResponse.Result;
}

ImportProductSetsAsync(String, ImportProductSetsInputConfig, CancellationToken)

public virtual Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>> ImportProductSetsAsync(string parent, ImportProductSetsInputConfig inputConfig, CancellationToken cancellationToken)

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results)

The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].

Parameters
NameDescription
parentString

Required. The project in which the ProductSets should be imported.

Format is projects/PROJECT_ID/locations/LOC_ID.

inputConfigImportProductSetsInputConfig

Required. The input content for the list of requests.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
ImportProductSetsInputConfig inputConfig = new ImportProductSetsInputConfig();
// Make the request
Operation<ImportProductSetsResponse, BatchOperationMetadata> response = await productSearchClient.ImportProductSetsAsync(parent, inputConfig);

// Poll until the returned long-running operation is complete
Operation<ImportProductSetsResponse, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportProductSetsResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<ImportProductSetsResponse, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOnceImportProductSetsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    ImportProductSetsResponse retrievedResult = retrievedResponse.Result;
}

ListProducts(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListProductsResponse, Product> ListProducts(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists products in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
parentLocationName

Required. The project OR ProductSet from which Products should be listed.

Format: projects/PROJECT_ID/locations/LOC_ID

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProductsResponse, Product>

A pageable sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListProductsResponse, Product> response = productSearchClient.ListProducts(parent);

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

ListProducts(ListProductsRequest, CallSettings)

public virtual PagedEnumerable<ListProductsResponse, Product> ListProducts(ListProductsRequest request, CallSettings callSettings = null)

Lists products in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
requestListProductsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProductsResponse, Product>

A pageable sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ListProductsRequest request = new ListProductsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListProductsResponse, Product> response = productSearchClient.ListProducts(request);

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

ListProducts(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListProductsResponse, Product> ListProducts(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists products in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
parentString

Required. The project OR ProductSet from which Products should be listed.

Format: projects/PROJECT_ID/locations/LOC_ID

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProductsResponse, Product>

A pageable sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListProductsResponse, Product> response = productSearchClient.ListProducts(parent);

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

ListProductsAsync(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListProductsResponse, Product> ListProductsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists products in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
parentLocationName

Required. The project OR ProductSet from which Products should be listed.

Format: projects/PROJECT_ID/locations/LOC_ID

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProductsResponse, Product>

A pageable asynchronous sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListProductsResponse, Product> response = productSearchClient.ListProductsAsync(parent);

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

ListProductsAsync(ListProductsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListProductsResponse, Product> ListProductsAsync(ListProductsRequest request, CallSettings callSettings = null)

Lists products in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
requestListProductsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProductsResponse, Product>

A pageable asynchronous sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ListProductsRequest request = new ListProductsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListProductsResponse, Product> response = productSearchClient.ListProductsAsync(request);

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

ListProductsAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListProductsResponse, Product> ListProductsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists products in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
parentString

Required. The project OR ProductSet from which Products should be listed.

Format: projects/PROJECT_ID/locations/LOC_ID

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProductsResponse, Product>

A pageable asynchronous sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListProductsResponse, Product> response = productSearchClient.ListProductsAsync(parent);

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

ListProductSets(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListProductSetsResponse, ProductSet> ListProductSets(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ProductSets in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
Parameters
NameDescription
parentLocationName

Required. The project from which ProductSets should be listed.

Format is projects/PROJECT_ID/locations/LOC_ID.

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProductSetsResponse, ProductSet>

A pageable sequence of ProductSet resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListProductSetsResponse, ProductSet> response = productSearchClient.ListProductSets(parent);

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

ListProductSets(ListProductSetsRequest, CallSettings)

public virtual PagedEnumerable<ListProductSetsResponse, ProductSet> ListProductSets(ListProductSetsRequest request, CallSettings callSettings = null)

Lists ProductSets in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
Parameters
NameDescription
requestListProductSetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProductSetsResponse, ProductSet>

A pageable sequence of ProductSet resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ListProductSetsRequest request = new ListProductSetsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListProductSetsResponse, ProductSet> response = productSearchClient.ListProductSets(request);

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

ListProductSets(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListProductSetsResponse, ProductSet> ListProductSets(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ProductSets in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
Parameters
NameDescription
parentString

Required. The project from which ProductSets should be listed.

Format is projects/PROJECT_ID/locations/LOC_ID.

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProductSetsResponse, ProductSet>

A pageable sequence of ProductSet resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListProductSetsResponse, ProductSet> response = productSearchClient.ListProductSets(parent);

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

ListProductSetsAsync(LocationName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListProductSetsResponse, ProductSet> ListProductSetsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ProductSets in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
Parameters
NameDescription
parentLocationName

Required. The project from which ProductSets should be listed.

Format is projects/PROJECT_ID/locations/LOC_ID.

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProductSetsResponse, ProductSet>

A pageable asynchronous sequence of ProductSet resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListProductSetsResponse, ProductSet> response = productSearchClient.ListProductSetsAsync(parent);

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

ListProductSetsAsync(ListProductSetsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListProductSetsResponse, ProductSet> ListProductSetsAsync(ListProductSetsRequest request, CallSettings callSettings = null)

Lists ProductSets in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
Parameters
NameDescription
requestListProductSetsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProductSetsResponse, ProductSet>

A pageable asynchronous sequence of ProductSet resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ListProductSetsRequest request = new ListProductSetsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListProductSetsResponse, ProductSet> response = productSearchClient.ListProductSetsAsync(request);

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

ListProductSetsAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListProductSetsResponse, ProductSet> ListProductSetsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists ProductSets in an unspecified order.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
Parameters
NameDescription
parentString

Required. The project from which ProductSets should be listed.

Format is projects/PROJECT_ID/locations/LOC_ID.

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProductSetsResponse, ProductSet>

A pageable asynchronous sequence of ProductSet resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListProductSetsResponse, ProductSet> response = productSearchClient.ListProductSetsAsync(parent);

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

ListProductsInProductSet(ListProductsInProductSetRequest, CallSettings)

public virtual PagedEnumerable<ListProductsInProductSetResponse, Product> ListProductsInProductSet(ListProductsInProductSetRequest request, CallSettings callSettings = null)

Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
requestListProductsInProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProductsInProductSetResponse, Product>

A pageable sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ListProductsInProductSetRequest request = new ListProductsInProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
};
// Make the request
PagedEnumerable<ListProductsInProductSetResponse, Product> response = productSearchClient.ListProductsInProductSet(request);

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

ListProductsInProductSet(ProductSetName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListProductsInProductSetResponse, Product> ListProductsInProductSet(ProductSetName name, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
nameProductSetName

Required. The ProductSet resource for which to retrieve Products.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProductsInProductSetResponse, Product>

A pageable sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
// Make the request
PagedEnumerable<ListProductsInProductSetResponse, Product> response = productSearchClient.ListProductsInProductSet(name);

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

ListProductsInProductSet(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListProductsInProductSetResponse, Product> ListProductsInProductSet(string name, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
nameString

Required. The ProductSet resource for which to retrieve Products.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListProductsInProductSetResponse, Product>

A pageable sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
// Make the request
PagedEnumerable<ListProductsInProductSetResponse, Product> response = productSearchClient.ListProductsInProductSet(name);

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

ListProductsInProductSetAsync(ListProductsInProductSetRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListProductsInProductSetResponse, Product> ListProductsInProductSetAsync(ListProductsInProductSetRequest request, CallSettings callSettings = null)

Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
requestListProductsInProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProductsInProductSetResponse, Product>

A pageable asynchronous sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ListProductsInProductSetRequest request = new ListProductsInProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
};
// Make the request
PagedAsyncEnumerable<ListProductsInProductSetResponse, Product> response = productSearchClient.ListProductsInProductSetAsync(request);

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

ListProductsInProductSetAsync(ProductSetName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListProductsInProductSetResponse, Product> ListProductsInProductSetAsync(ProductSetName name, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
nameProductSetName

Required. The ProductSet resource for which to retrieve Products.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProductsInProductSetResponse, Product>

A pageable asynchronous sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
// Make the request
PagedAsyncEnumerable<ListProductsInProductSetResponse, Product> response = productSearchClient.ListProductsInProductSetAsync(name);

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

ListProductsInProductSetAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListProductsInProductSetResponse, Product> ListProductsInProductSetAsync(string name, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists the Products in a ProductSet, in an unspecified order. If the ProductSet does not exist, the products field of the response will be empty.

Possible errors:

  • Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
Parameters
NameDescription
nameString

Required. The ProductSet resource for which to retrieve Products.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListProductsInProductSetResponse, Product>

A pageable asynchronous sequence of Product resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
// Make the request
PagedAsyncEnumerable<ListProductsInProductSetResponse, Product> response = productSearchClient.ListProductsInProductSetAsync(name);

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

ListReferenceImages(ListReferenceImagesRequest, CallSettings)

public virtual PagedEnumerable<ListReferenceImagesResponse, ReferenceImage> ListReferenceImages(ListReferenceImagesRequest request, CallSettings callSettings = null)

Lists reference images.

Possible errors:

  • Returns NOT_FOUND if the parent product does not exist.
  • Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.
Parameters
NameDescription
requestListReferenceImagesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListReferenceImagesResponse, ReferenceImage>

A pageable sequence of ReferenceImage resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ListReferenceImagesRequest request = new ListReferenceImagesRequest
{
    ParentAsProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
PagedEnumerable<ListReferenceImagesResponse, ReferenceImage> response = productSearchClient.ListReferenceImages(request);

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

ListReferenceImages(ProductName, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListReferenceImagesResponse, ReferenceImage> ListReferenceImages(ProductName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists reference images.

Possible errors:

  • Returns NOT_FOUND if the parent product does not exist.
  • Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.
Parameters
NameDescription
parentProductName

Required. Resource name of the product containing the reference images.

Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListReferenceImagesResponse, ReferenceImage>

A pageable sequence of ReferenceImage resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ProductName parent = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
PagedEnumerable<ListReferenceImagesResponse, ReferenceImage> response = productSearchClient.ListReferenceImages(parent);

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

ListReferenceImages(String, String, Nullable<Int32>, CallSettings)

public virtual PagedEnumerable<ListReferenceImagesResponse, ReferenceImage> ListReferenceImages(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists reference images.

Possible errors:

  • Returns NOT_FOUND if the parent product does not exist.
  • Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.
Parameters
NameDescription
parentString

Required. Resource name of the product containing the reference images.

Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListReferenceImagesResponse, ReferenceImage>

A pageable sequence of ReferenceImage resources.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
PagedEnumerable<ListReferenceImagesResponse, ReferenceImage> response = productSearchClient.ListReferenceImages(parent);

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

ListReferenceImagesAsync(ListReferenceImagesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListReferenceImagesResponse, ReferenceImage> ListReferenceImagesAsync(ListReferenceImagesRequest request, CallSettings callSettings = null)

Lists reference images.

Possible errors:

  • Returns NOT_FOUND if the parent product does not exist.
  • Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.
Parameters
NameDescription
requestListReferenceImagesRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListReferenceImagesResponse, ReferenceImage>

A pageable asynchronous sequence of ReferenceImage resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ListReferenceImagesRequest request = new ListReferenceImagesRequest
{
    ParentAsProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
PagedAsyncEnumerable<ListReferenceImagesResponse, ReferenceImage> response = productSearchClient.ListReferenceImagesAsync(request);

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

ListReferenceImagesAsync(ProductName, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListReferenceImagesResponse, ReferenceImage> ListReferenceImagesAsync(ProductName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists reference images.

Possible errors:

  • Returns NOT_FOUND if the parent product does not exist.
  • Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.
Parameters
NameDescription
parentProductName

Required. Resource name of the product containing the reference images.

Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListReferenceImagesResponse, ReferenceImage>

A pageable asynchronous sequence of ReferenceImage resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductName parent = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
PagedAsyncEnumerable<ListReferenceImagesResponse, ReferenceImage> response = productSearchClient.ListReferenceImagesAsync(parent);

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

ListReferenceImagesAsync(String, String, Nullable<Int32>, CallSettings)

public virtual PagedAsyncEnumerable<ListReferenceImagesResponse, ReferenceImage> ListReferenceImagesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists reference images.

Possible errors:

  • Returns NOT_FOUND if the parent product does not exist.
  • Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.
Parameters
NameDescription
parentString

Required. Resource name of the product containing the reference images.

Format is projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.

pageTokenString

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

pageSizeNullable<Int32>

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListReferenceImagesResponse, ReferenceImage>

A pageable asynchronous sequence of ReferenceImage resources.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
PagedAsyncEnumerable<ListReferenceImagesResponse, ReferenceImage> response = productSearchClient.ListReferenceImagesAsync(parent);

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

PollOnceImportProductSets(String, CallSettings)

public virtual Operation<ImportProductSetsResponse, BatchOperationMetadata> PollOnceImportProductSets(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of ImportProductSets .

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<ImportProductSetsResponse, BatchOperationMetadata>

The result of polling the operation.

PollOnceImportProductSetsAsync(String, CallSettings)

public virtual Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>> PollOnceImportProductSetsAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of ImportProductSets.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<ImportProductSetsResponse, BatchOperationMetadata>>

A task representing the result of polling the operation.

PollOncePurgeProducts(String, CallSettings)

public virtual Operation<Empty, BatchOperationMetadata> PollOncePurgeProducts(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of PurgeProducts.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, BatchOperationMetadata>

The result of polling the operation.

PollOncePurgeProductsAsync(String, CallSettings)

public virtual Task<Operation<Empty, BatchOperationMetadata>> PollOncePurgeProductsAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of PurgeProducts.

Parameters
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, BatchOperationMetadata>>

A task representing the result of polling the operation.

PurgeProducts(LocationName, CallSettings)

public virtual Operation<Empty, BatchOperationMetadata> PurgeProducts(LocationName parent, CallSettings callSettings = null)

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.

If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.

It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.

If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

Parameters
NameDescription
parentLocationName

Required. The project and location in which the Products should be deleted.

Format is projects/PROJECT_ID/locations/LOC_ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, BatchOperationMetadata>

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
Operation<Empty, BatchOperationMetadata> response = productSearchClient.PurgeProducts(parent);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse = productSearchClient.PollOncePurgeProducts(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

PurgeProducts(PurgeProductsRequest, CallSettings)

public virtual Operation<Empty, BatchOperationMetadata> PurgeProducts(PurgeProductsRequest request, CallSettings callSettings = null)

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.

If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.

It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.

If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

Parameters
NameDescription
requestPurgeProductsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, BatchOperationMetadata>

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
PurgeProductsRequest request = new PurgeProductsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ProductSetPurgeConfig = new ProductSetPurgeConfig(),
    Force = false,
};
// Make the request
Operation<Empty, BatchOperationMetadata> response = productSearchClient.PurgeProducts(request);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse = productSearchClient.PollOncePurgeProducts(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

PurgeProducts(String, CallSettings)

public virtual Operation<Empty, BatchOperationMetadata> PurgeProducts(string parent, CallSettings callSettings = null)

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.

If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.

It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.

If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

Parameters
NameDescription
parentString

Required. The project and location in which the Products should be deleted.

Format is projects/PROJECT_ID/locations/LOC_ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, BatchOperationMetadata>

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
Operation<Empty, BatchOperationMetadata> response = productSearchClient.PurgeProducts(parent);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse = productSearchClient.PollOncePurgeProducts(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

PurgeProductsAsync(LocationName, CallSettings)

public virtual Task<Operation<Empty, BatchOperationMetadata>> PurgeProductsAsync(LocationName parent, CallSettings callSettings = null)

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.

If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.

It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.

If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

Parameters
NameDescription
parentLocationName

Required. The project and location in which the Products should be deleted.

Format is projects/PROJECT_ID/locations/LOC_ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
Operation<Empty, BatchOperationMetadata> response = await productSearchClient.PurgeProductsAsync(parent);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOncePurgeProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

PurgeProductsAsync(LocationName, CancellationToken)

public virtual Task<Operation<Empty, BatchOperationMetadata>> PurgeProductsAsync(LocationName parent, CancellationToken cancellationToken)

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.

If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.

It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.

If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

Parameters
NameDescription
parentLocationName

Required. The project and location in which the Products should be deleted.

Format is projects/PROJECT_ID/locations/LOC_ID.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
Operation<Empty, BatchOperationMetadata> response = await productSearchClient.PurgeProductsAsync(parent);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOncePurgeProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

PurgeProductsAsync(PurgeProductsRequest, CallSettings)

public virtual Task<Operation<Empty, BatchOperationMetadata>> PurgeProductsAsync(PurgeProductsRequest request, CallSettings callSettings = null)

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.

If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.

It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.

If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

Parameters
NameDescription
requestPurgeProductsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
PurgeProductsRequest request = new PurgeProductsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ProductSetPurgeConfig = new ProductSetPurgeConfig(),
    Force = false,
};
// Make the request
Operation<Empty, BatchOperationMetadata> response = await productSearchClient.PurgeProductsAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOncePurgeProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

PurgeProductsAsync(PurgeProductsRequest, CancellationToken)

public virtual Task<Operation<Empty, BatchOperationMetadata>> PurgeProductsAsync(PurgeProductsRequest request, CancellationToken cancellationToken)

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.

If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.

It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.

If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

Parameters
NameDescription
requestPurgeProductsRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
PurgeProductsRequest request = new PurgeProductsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    ProductSetPurgeConfig = new ProductSetPurgeConfig(),
    Force = false,
};
// Make the request
Operation<Empty, BatchOperationMetadata> response = await productSearchClient.PurgeProductsAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOncePurgeProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

PurgeProductsAsync(String, CallSettings)

public virtual Task<Operation<Empty, BatchOperationMetadata>> PurgeProductsAsync(string parent, CallSettings callSettings = null)

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.

If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.

It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.

If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

Parameters
NameDescription
parentString

Required. The project and location in which the Products should be deleted.

Format is projects/PROJECT_ID/locations/LOC_ID.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
Operation<Empty, BatchOperationMetadata> response = await productSearchClient.PurgeProductsAsync(parent);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOncePurgeProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

PurgeProductsAsync(String, CancellationToken)

public virtual Task<Operation<Empty, BatchOperationMetadata>> PurgeProductsAsync(string parent, CancellationToken cancellationToken)

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet.

If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted.

It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted.

It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion.

If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet.

The [google.longrunning.Operation][google.longrunning.Operation] API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

Parameters
NameDescription
parentString

Required. The project and location in which the Products should be deleted.

Format is projects/PROJECT_ID/locations/LOC_ID.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, BatchOperationMetadata>>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
Operation<Empty, BatchOperationMetadata> response = await productSearchClient.PurgeProductsAsync(parent);

// Poll until the returned long-running operation is complete
Operation<Empty, BatchOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, BatchOperationMetadata> retrievedResponse = await productSearchClient.PollOncePurgeProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

RemoveProductFromProductSet(ProductSetName, ProductName, CallSettings)

public virtual void RemoveProductFromProductSet(ProductSetName name, ProductName product, CallSettings callSettings = null)

Removes a Product from the specified ProductSet.

Parameters
NameDescription
nameProductSetName

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productProductName

Required. The resource name for the Product to be removed from this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
ProductName product = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
productSearchClient.RemoveProductFromProductSet(name, product);

RemoveProductFromProductSet(RemoveProductFromProductSetRequest, CallSettings)

public virtual void RemoveProductFromProductSet(RemoveProductFromProductSetRequest request, CallSettings callSettings = null)

Removes a Product from the specified ProductSet.

Parameters
NameDescription
requestRemoveProductFromProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
RemoveProductFromProductSetRequest request = new RemoveProductFromProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
    ProductAsProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
productSearchClient.RemoveProductFromProductSet(request);

RemoveProductFromProductSet(String, String, CallSettings)

public virtual void RemoveProductFromProductSet(string name, string product, CallSettings callSettings = null)

Removes a Product from the specified ProductSet.

Parameters
NameDescription
nameString

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productString

Required. The resource name for the Product to be removed from this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
string product = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
productSearchClient.RemoveProductFromProductSet(name, product);

RemoveProductFromProductSetAsync(ProductSetName, ProductName, CallSettings)

public virtual Task RemoveProductFromProductSetAsync(ProductSetName name, ProductName product, CallSettings callSettings = null)

Removes a Product from the specified ProductSet.

Parameters
NameDescription
nameProductSetName

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productProductName

Required. The resource name for the Product to be removed from this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
ProductName product = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
await productSearchClient.RemoveProductFromProductSetAsync(name, product);

RemoveProductFromProductSetAsync(ProductSetName, ProductName, CancellationToken)

public virtual Task RemoveProductFromProductSetAsync(ProductSetName name, ProductName product, CancellationToken cancellationToken)

Removes a Product from the specified ProductSet.

Parameters
NameDescription
nameProductSetName

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productProductName

Required. The resource name for the Product to be removed from this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductSetName name = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]");
ProductName product = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]");
// Make the request
await productSearchClient.RemoveProductFromProductSetAsync(name, product);

RemoveProductFromProductSetAsync(RemoveProductFromProductSetRequest, CallSettings)

public virtual Task RemoveProductFromProductSetAsync(RemoveProductFromProductSetRequest request, CallSettings callSettings = null)

Removes a Product from the specified ProductSet.

Parameters
NameDescription
requestRemoveProductFromProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
RemoveProductFromProductSetRequest request = new RemoveProductFromProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
    ProductAsProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
await productSearchClient.RemoveProductFromProductSetAsync(request);

RemoveProductFromProductSetAsync(RemoveProductFromProductSetRequest, CancellationToken)

public virtual Task RemoveProductFromProductSetAsync(RemoveProductFromProductSetRequest request, CancellationToken cancellationToken)

Removes a Product from the specified ProductSet.

Parameters
NameDescription
requestRemoveProductFromProductSetRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
RemoveProductFromProductSetRequest request = new RemoveProductFromProductSetRequest
{
    ProductSetName = ProductSetName.FromProjectLocationProductSet("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]"),
    ProductAsProductName = ProductName.FromProjectLocationProduct("[PROJECT]", "[LOCATION]", "[PRODUCT]"),
};
// Make the request
await productSearchClient.RemoveProductFromProductSetAsync(request);

RemoveProductFromProductSetAsync(String, String, CallSettings)

public virtual Task RemoveProductFromProductSetAsync(string name, string product, CallSettings callSettings = null)

Removes a Product from the specified ProductSet.

Parameters
NameDescription
nameString

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productString

Required. The resource name for the Product to be removed from this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
string product = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
await productSearchClient.RemoveProductFromProductSetAsync(name, product);

RemoveProductFromProductSetAsync(String, String, CancellationToken)

public virtual Task RemoveProductFromProductSetAsync(string name, string product, CancellationToken cancellationToken)

Removes a Product from the specified ProductSet.

Parameters
NameDescription
nameString

Required. The resource name for the ProductSet to modify.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID

productString

Required. The resource name for the Product to be removed from this ProductSet.

Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/productSets/[PRODUCT_SET]";
string product = "projects/[PROJECT]/locations/[LOCATION]/products/[PRODUCT]";
// Make the request
await productSearchClient.RemoveProductFromProductSetAsync(name, product);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
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.

UpdateProduct(Product, FieldMask, CallSettings)

public virtual Product UpdateProduct(Product product, FieldMask updateMask, CallSettings callSettings = null)

Makes changes to a Product resource. Only the display_name, description, and labels fields can be updated right now.

If labels are updated, the change will not be reflected in queries until the next index time.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is present in update_mask.
Parameters
NameDescription
productProduct

Required. The Product resource which replaces the one on the server. product.name is immutable.

updateMaskFieldMask

The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include product_labels, display_name, and description.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Product

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
Product product = new Product();
FieldMask updateMask = new FieldMask();
// Make the request
Product response = productSearchClient.UpdateProduct(product, updateMask);

UpdateProduct(UpdateProductRequest, CallSettings)

public virtual Product UpdateProduct(UpdateProductRequest request, CallSettings callSettings = null)

Makes changes to a Product resource. Only the display_name, description, and labels fields can be updated right now.

If labels are updated, the change will not be reflected in queries until the next index time.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is present in update_mask.
Parameters
NameDescription
requestUpdateProductRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Product

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
UpdateProductRequest request = new UpdateProductRequest
{
    Product = new Product(),
    UpdateMask = new FieldMask(),
};
// Make the request
Product response = productSearchClient.UpdateProduct(request);

UpdateProductAsync(Product, FieldMask, CallSettings)

public virtual Task<Product> UpdateProductAsync(Product product, FieldMask updateMask, CallSettings callSettings = null)

Makes changes to a Product resource. Only the display_name, description, and labels fields can be updated right now.

If labels are updated, the change will not be reflected in queries until the next index time.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is present in update_mask.
Parameters
NameDescription
productProduct

Required. The Product resource which replaces the one on the server. product.name is immutable.

updateMaskFieldMask

The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include product_labels, display_name, and description.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
Product product = new Product();
FieldMask updateMask = new FieldMask();
// Make the request
Product response = await productSearchClient.UpdateProductAsync(product, updateMask);

UpdateProductAsync(Product, FieldMask, CancellationToken)

public virtual Task<Product> UpdateProductAsync(Product product, FieldMask updateMask, CancellationToken cancellationToken)

Makes changes to a Product resource. Only the display_name, description, and labels fields can be updated right now.

If labels are updated, the change will not be reflected in queries until the next index time.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is present in update_mask.
Parameters
NameDescription
productProduct

Required. The Product resource which replaces the one on the server. product.name is immutable.

updateMaskFieldMask

The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include product_labels, display_name, and description.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
Product product = new Product();
FieldMask updateMask = new FieldMask();
// Make the request
Product response = await productSearchClient.UpdateProductAsync(product, updateMask);

UpdateProductAsync(UpdateProductRequest, CallSettings)

public virtual Task<Product> UpdateProductAsync(UpdateProductRequest request, CallSettings callSettings = null)

Makes changes to a Product resource. Only the display_name, description, and labels fields can be updated right now.

If labels are updated, the change will not be reflected in queries until the next index time.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is present in update_mask.
Parameters
NameDescription
requestUpdateProductRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
UpdateProductRequest request = new UpdateProductRequest
{
    Product = new Product(),
    UpdateMask = new FieldMask(),
};
// Make the request
Product response = await productSearchClient.UpdateProductAsync(request);

UpdateProductAsync(UpdateProductRequest, CancellationToken)

public virtual Task<Product> UpdateProductAsync(UpdateProductRequest request, CancellationToken cancellationToken)

Makes changes to a Product resource. Only the display_name, description, and labels fields can be updated right now.

If labels are updated, the change will not be reflected in queries until the next index time.

Possible errors:

  • Returns NOT_FOUND if the Product does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters.
  • Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters.
  • Returns INVALID_ARGUMENT if product_category is present in update_mask.
Parameters
NameDescription
requestUpdateProductRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Product>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
UpdateProductRequest request = new UpdateProductRequest
{
    Product = new Product(),
    UpdateMask = new FieldMask(),
};
// Make the request
Product response = await productSearchClient.UpdateProductAsync(request);

UpdateProductSet(ProductSet, FieldMask, CallSettings)

public virtual ProductSet UpdateProductSet(ProductSet productSet, FieldMask updateMask, CallSettings callSettings = null)

Makes changes to a ProductSet resource. Only display_name can be updated currently.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.
Parameters
NameDescription
productSetProductSet

Required. The ProductSet resource which replaces the one on the server.

updateMaskFieldMask

The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask path is display_name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProductSet

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
ProductSet productSet = new ProductSet();
FieldMask updateMask = new FieldMask();
// Make the request
ProductSet response = productSearchClient.UpdateProductSet(productSet, updateMask);

UpdateProductSet(UpdateProductSetRequest, CallSettings)

public virtual ProductSet UpdateProductSet(UpdateProductSetRequest request, CallSettings callSettings = null)

Makes changes to a ProductSet resource. Only display_name can be updated currently.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.
Parameters
NameDescription
requestUpdateProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ProductSet

The RPC response.

Example
// Create client
ProductSearchClient productSearchClient = ProductSearchClient.Create();
// Initialize request argument(s)
UpdateProductSetRequest request = new UpdateProductSetRequest
{
    ProductSet = new ProductSet(),
    UpdateMask = new FieldMask(),
};
// Make the request
ProductSet response = productSearchClient.UpdateProductSet(request);

UpdateProductSetAsync(ProductSet, FieldMask, CallSettings)

public virtual Task<ProductSet> UpdateProductSetAsync(ProductSet productSet, FieldMask updateMask, CallSettings callSettings = null)

Makes changes to a ProductSet resource. Only display_name can be updated currently.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.
Parameters
NameDescription
productSetProductSet

Required. The ProductSet resource which replaces the one on the server.

updateMaskFieldMask

The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask path is display_name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductSet productSet = new ProductSet();
FieldMask updateMask = new FieldMask();
// Make the request
ProductSet response = await productSearchClient.UpdateProductSetAsync(productSet, updateMask);

UpdateProductSetAsync(ProductSet, FieldMask, CancellationToken)

public virtual Task<ProductSet> UpdateProductSetAsync(ProductSet productSet, FieldMask updateMask, CancellationToken cancellationToken)

Makes changes to a ProductSet resource. Only display_name can be updated currently.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.
Parameters
NameDescription
productSetProductSet

Required. The ProductSet resource which replaces the one on the server.

updateMaskFieldMask

The [FieldMask][google.protobuf.FieldMask] that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask path is display_name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
ProductSet productSet = new ProductSet();
FieldMask updateMask = new FieldMask();
// Make the request
ProductSet response = await productSearchClient.UpdateProductSetAsync(productSet, updateMask);

UpdateProductSetAsync(UpdateProductSetRequest, CallSettings)

public virtual Task<ProductSet> UpdateProductSetAsync(UpdateProductSetRequest request, CallSettings callSettings = null)

Makes changes to a ProductSet resource. Only display_name can be updated currently.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.
Parameters
NameDescription
requestUpdateProductSetRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
UpdateProductSetRequest request = new UpdateProductSetRequest
{
    ProductSet = new ProductSet(),
    UpdateMask = new FieldMask(),
};
// Make the request
ProductSet response = await productSearchClient.UpdateProductSetAsync(request);

UpdateProductSetAsync(UpdateProductSetRequest, CancellationToken)

public virtual Task<ProductSet> UpdateProductSetAsync(UpdateProductSetRequest request, CancellationToken cancellationToken)

Makes changes to a ProductSet resource. Only display_name can be updated currently.

Possible errors:

  • Returns NOT_FOUND if the ProductSet does not exist.
  • Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.
Parameters
NameDescription
requestUpdateProductSetRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<ProductSet>

A Task containing the RPC response.

Example
// Create client
ProductSearchClient productSearchClient = await ProductSearchClient.CreateAsync();
// Initialize request argument(s)
UpdateProductSetRequest request = new UpdateProductSetRequest
{
    ProductSet = new ProductSet(),
    UpdateMask = new FieldMask(),
};
// Make the request
ProductSet response = await productSearchClient.UpdateProductSetAsync(request);