public abstract class ProductServiceClient
ProductService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Retail.V2Assembly
Google.Cloud.Retail.V2.dll
Remarks
Service for ingesting [Product][google.cloud.retail.v2.Product] information of the customer's website.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the ProductService service, which is a host of "retail.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default ProductService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default ProductService scopes are:
GrpcClient
public virtual ProductService.ProductServiceClient GrpcClient { get; }
The underlying gRPC ProductService client
Property Value | |
---|---|
Type | Description |
ProductService.ProductServiceClient |
ImportProductsOperationsClient
public virtual OperationsClient ImportProductsOperationsClient { get; }
The long-running operations client for ImportProducts
.
Property Value | |
---|---|
Type | Description |
Google.LongRunning.OperationsClient |
Methods
Create()
public static ProductServiceClient Create()
Synchronously creates a ProductServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ProductServiceClientBuilder.
Returns | |
---|---|
Type | Description |
ProductServiceClient | The created ProductServiceClient. |
CreateAsync(CancellationToken)
public static Task<ProductServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a ProductServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ProductServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
Task<ProductServiceClient> | The task representing the created ProductServiceClient. |
CreateProduct(BranchName, Product, String, CallSettings)
public virtual Product CreateProduct(BranchName parent, Product product, string productId, CallSettings callSettings = null)
Creates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
parent | BranchName Required. The parent catalog resource name, such as
|
product | Product Required. The [Product][google.cloud.retail.v2.Product] to create. |
productId | String Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name]. If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Product | The RPC response. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
BranchName parent = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
Product product = new Product();
string productId = "";
// Make the request
Product response = productServiceClient.CreateProduct(parent, product, productId);
CreateProduct(CreateProductRequest, CallSettings)
public virtual Product CreateProduct(CreateProductRequest request, CallSettings callSettings = null)
Creates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | CreateProductRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Product | The RPC response. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
CreateProductRequest request = new CreateProductRequest
{
ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
Product = new Product(),
ProductId = "",
};
// Make the request
Product response = productServiceClient.CreateProduct(request);
CreateProduct(String, Product, String, CallSettings)
public virtual Product CreateProduct(string parent, Product product, string productId, CallSettings callSettings = null)
Creates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
parent | String Required. The parent catalog resource name, such as
|
product | Product Required. The [Product][google.cloud.retail.v2.Product] to create. |
productId | String Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name]. If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Product | The RPC response. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]";
Product product = new Product();
string productId = "";
// Make the request
Product response = productServiceClient.CreateProduct(parent, product, productId);
CreateProductAsync(BranchName, Product, String, CallSettings)
public virtual Task<Product> CreateProductAsync(BranchName parent, Product product, string productId, CallSettings callSettings = null)
Creates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
parent | BranchName Required. The parent catalog resource name, such as
|
product | Product Required. The [Product][google.cloud.retail.v2.Product] to create. |
productId | String Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name]. If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
BranchName parent = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
Product product = new Product();
string productId = "";
// Make the request
Product response = await productServiceClient.CreateProductAsync(parent, product, productId);
CreateProductAsync(BranchName, Product, String, CancellationToken)
public virtual Task<Product> CreateProductAsync(BranchName parent, Product product, string productId, CancellationToken cancellationToken)
Creates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
parent | BranchName Required. The parent catalog resource name, such as
|
product | Product Required. The [Product][google.cloud.retail.v2.Product] to create. |
productId | String Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name]. If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
BranchName parent = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]");
Product product = new Product();
string productId = "";
// Make the request
Product response = await productServiceClient.CreateProductAsync(parent, product, productId);
CreateProductAsync(CreateProductRequest, CallSettings)
public virtual Task<Product> CreateProductAsync(CreateProductRequest request, CallSettings callSettings = null)
Creates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | CreateProductRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
CreateProductRequest request = new CreateProductRequest
{
ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
Product = new Product(),
ProductId = "",
};
// Make the request
Product response = await productServiceClient.CreateProductAsync(request);
CreateProductAsync(CreateProductRequest, CancellationToken)
public virtual Task<Product> CreateProductAsync(CreateProductRequest request, CancellationToken cancellationToken)
Creates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | CreateProductRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
CreateProductRequest request = new CreateProductRequest
{
ParentAsBranchName = BranchName.FromProjectLocationCatalogBranch("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]"),
Product = new Product(),
ProductId = "",
};
// Make the request
Product response = await productServiceClient.CreateProductAsync(request);
CreateProductAsync(String, Product, String, CallSettings)
public virtual Task<Product> CreateProductAsync(string parent, Product product, string productId, CallSettings callSettings = null)
Creates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
parent | String Required. The parent catalog resource name, such as
|
product | Product Required. The [Product][google.cloud.retail.v2.Product] to create. |
productId | String Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name]. If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]";
Product product = new Product();
string productId = "";
// Make the request
Product response = await productServiceClient.CreateProductAsync(parent, product, productId);
CreateProductAsync(String, Product, String, CancellationToken)
public virtual Task<Product> CreateProductAsync(string parent, Product product, string productId, CancellationToken cancellationToken)
Creates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
parent | String Required. The parent catalog resource name, such as
|
product | Product Required. The [Product][google.cloud.retail.v2.Product] to create. |
productId | String Required. The ID to use for the [Product][google.cloud.retail.v2.Product], which will become the final component of the [Product.name][google.cloud.retail.v2.Product.name]. If the caller does not have permission to create the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. This field must be unique among all [Product][google.cloud.retail.v2.Product]s with the same [parent][google.cloud.retail.v2.CreateProductRequest.parent]. Otherwise, an ALREADY_EXISTS error is returned. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]";
Product product = new Product();
string productId = "";
// Make the request
Product response = await productServiceClient.CreateProductAsync(parent, product, productId);
DeleteProduct(DeleteProductRequest, CallSettings)
public virtual void DeleteProduct(DeleteProductRequest request, CallSettings callSettings = null)
Deletes a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | DeleteProductRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
DeleteProductRequest request = new DeleteProductRequest
{
ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
productServiceClient.DeleteProduct(request);
DeleteProduct(ProductName, CallSettings)
public virtual void DeleteProduct(ProductName name, CallSettings callSettings = null)
Deletes a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | ProductName Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the [Product][google.cloud.retail.v2.Product] to delete does not exist, a NOT_FOUND error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
productServiceClient.DeleteProduct(name);
DeleteProduct(String, CallSettings)
public virtual void DeleteProduct(string name, CallSettings callSettings = null)
Deletes a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | String Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the [Product][google.cloud.retail.v2.Product] to delete does not exist, a NOT_FOUND error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
productServiceClient.DeleteProduct(name);
DeleteProductAsync(DeleteProductRequest, CallSettings)
public virtual Task DeleteProductAsync(DeleteProductRequest request, CallSettings callSettings = null)
Deletes a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | DeleteProductRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteProductRequest request = new DeleteProductRequest
{
ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
await productServiceClient.DeleteProductAsync(request);
DeleteProductAsync(DeleteProductRequest, CancellationToken)
public virtual Task DeleteProductAsync(DeleteProductRequest request, CancellationToken cancellationToken)
Deletes a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | DeleteProductRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteProductRequest request = new DeleteProductRequest
{
ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
await productServiceClient.DeleteProductAsync(request);
DeleteProductAsync(ProductName, CallSettings)
public virtual Task DeleteProductAsync(ProductName name, CallSettings callSettings = null)
Deletes a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | ProductName Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the [Product][google.cloud.retail.v2.Product] to delete does not exist, a NOT_FOUND error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
await productServiceClient.DeleteProductAsync(name);
DeleteProductAsync(ProductName, CancellationToken)
public virtual Task DeleteProductAsync(ProductName name, CancellationToken cancellationToken)
Deletes a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | ProductName Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the [Product][google.cloud.retail.v2.Product] to delete does not exist, a NOT_FOUND error is returned. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
await productServiceClient.DeleteProductAsync(name);
DeleteProductAsync(String, CallSettings)
public virtual Task DeleteProductAsync(string name, CallSettings callSettings = null)
Deletes a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | String Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the [Product][google.cloud.retail.v2.Product] to delete does not exist, a NOT_FOUND error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
await productServiceClient.DeleteProductAsync(name);
DeleteProductAsync(String, CancellationToken)
public virtual Task DeleteProductAsync(string name, CancellationToken cancellationToken)
Deletes a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | String Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to delete the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the [Product][google.cloud.retail.v2.Product] to delete does not exist, a NOT_FOUND error is returned. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
await productServiceClient.DeleteProductAsync(name);
GetProduct(GetProductRequest, CallSettings)
public virtual Product GetProduct(GetProductRequest request, CallSettings callSettings = null)
Gets a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | GetProductRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Product | The RPC response. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
GetProductRequest request = new GetProductRequest
{
ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
Product response = productServiceClient.GetProduct(request);
GetProduct(ProductName, CallSettings)
public virtual Product GetProduct(ProductName name, CallSettings callSettings = null)
Gets a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | ProductName Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Product | The RPC response. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Product response = productServiceClient.GetProduct(name);
GetProduct(String, CallSettings)
public virtual Product GetProduct(string name, CallSettings callSettings = null)
Gets a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | String Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Product | The RPC response. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Product response = productServiceClient.GetProduct(name);
GetProductAsync(GetProductRequest, CallSettings)
public virtual Task<Product> GetProductAsync(GetProductRequest request, CallSettings callSettings = null)
Gets a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | GetProductRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
GetProductRequest request = new GetProductRequest
{
ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
Product response = await productServiceClient.GetProductAsync(request);
GetProductAsync(GetProductRequest, CancellationToken)
public virtual Task<Product> GetProductAsync(GetProductRequest request, CancellationToken cancellationToken)
Gets a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | GetProductRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
GetProductRequest request = new GetProductRequest
{
ProductName = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]"),
};
// Make the request
Product response = await productServiceClient.GetProductAsync(request);
GetProductAsync(ProductName, CallSettings)
public virtual Task<Product> GetProductAsync(ProductName name, CallSettings callSettings = null)
Gets a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | ProductName Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Product response = await productServiceClient.GetProductAsync(name);
GetProductAsync(ProductName, CancellationToken)
public virtual Task<Product> GetProductAsync(ProductName name, CancellationToken cancellationToken)
Gets a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | ProductName Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ProductName name = ProductName.FromProjectLocationCatalogBranchProduct("[PROJECT]", "[LOCATION]", "[CATALOG]", "[BRANCH]", "[PRODUCT]");
// Make the request
Product response = await productServiceClient.GetProductAsync(name);
GetProductAsync(String, CallSettings)
public virtual Task<Product> GetProductAsync(string name, CallSettings callSettings = null)
Gets a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | String Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Product response = await productServiceClient.GetProductAsync(name);
GetProductAsync(String, CancellationToken)
public virtual Task<Product> GetProductAsync(string name, CancellationToken cancellationToken)
Gets a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
name | String Required. Full resource name of [Product][google.cloud.retail.v2.Product],
such as
If the caller does not have permission to access the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested [Product][google.cloud.retail.v2.Product] does not exist, a NOT_FOUND error is returned. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/catalogs/[CATALOG]/branches/[BRANCH]/products/[PRODUCT]";
// Make the request
Product response = await productServiceClient.GetProductAsync(name);
ImportProducts(ImportProductsRequest, CallSettings)
public virtual Operation<ImportProductsResponse, ImportMetadata> ImportProducts(ImportProductsRequest request, CallSettings callSettings = null)
Bulk import of multiple [Product][google.cloud.retail.v2.Product]s.
Request processing may be synchronous. No partial updating is supported. Non-existing items are created.
Note that it is possible for a subset of the [Product][google.cloud.retail.v2.Product]s to be successfully updated.
Parameters | |
---|---|
Name | Description |
request | ImportProductsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Google.LongRunning.Operation<ImportProductsResponse, ImportMetadata> | The RPC response. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
ImportProductsRequest request = new ImportProductsRequest
{
Parent = "",
InputConfig = new ProductInputConfig(),
ErrorsConfig = new ImportErrorsConfig(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<ImportProductsResponse, ImportMetadata> response = productServiceClient.ImportProducts(request);
// Poll until the returned long-running operation is complete
Operation<ImportProductsResponse, ImportMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ImportProductsResponse 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<ImportProductsResponse, ImportMetadata> retrievedResponse = productServiceClient.PollOnceImportProducts(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
ImportProductsResponse retrievedResult = retrievedResponse.Result;
}
ImportProductsAsync(ImportProductsRequest, CallSettings)
public virtual Task<Operation<ImportProductsResponse, ImportMetadata>> ImportProductsAsync(ImportProductsRequest request, CallSettings callSettings = null)
Bulk import of multiple [Product][google.cloud.retail.v2.Product]s.
Request processing may be synchronous. No partial updating is supported. Non-existing items are created.
Note that it is possible for a subset of the [Product][google.cloud.retail.v2.Product]s to be successfully updated.
Parameters | |
---|---|
Name | Description |
request | ImportProductsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Google.LongRunning.Operation<ImportProductsResponse, ImportMetadata>> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ImportProductsRequest request = new ImportProductsRequest
{
Parent = "",
InputConfig = new ProductInputConfig(),
ErrorsConfig = new ImportErrorsConfig(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<ImportProductsResponse, ImportMetadata> response = await productServiceClient.ImportProductsAsync(request);
// Poll until the returned long-running operation is complete
Operation<ImportProductsResponse, ImportMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportProductsResponse 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<ImportProductsResponse, ImportMetadata> retrievedResponse = await productServiceClient.PollOnceImportProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
ImportProductsResponse retrievedResult = retrievedResponse.Result;
}
ImportProductsAsync(ImportProductsRequest, CancellationToken)
public virtual Task<Operation<ImportProductsResponse, ImportMetadata>> ImportProductsAsync(ImportProductsRequest request, CancellationToken cancellationToken)
Bulk import of multiple [Product][google.cloud.retail.v2.Product]s.
Request processing may be synchronous. No partial updating is supported. Non-existing items are created.
Note that it is possible for a subset of the [Product][google.cloud.retail.v2.Product]s to be successfully updated.
Parameters | |
---|---|
Name | Description |
request | ImportProductsRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Google.LongRunning.Operation<ImportProductsResponse, ImportMetadata>> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
ImportProductsRequest request = new ImportProductsRequest
{
Parent = "",
InputConfig = new ProductInputConfig(),
ErrorsConfig = new ImportErrorsConfig(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<ImportProductsResponse, ImportMetadata> response = await productServiceClient.ImportProductsAsync(request);
// Poll until the returned long-running operation is complete
Operation<ImportProductsResponse, ImportMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportProductsResponse 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<ImportProductsResponse, ImportMetadata> retrievedResponse = await productServiceClient.PollOnceImportProductsAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
ImportProductsResponse retrievedResult = retrievedResponse.Result;
}
PollOnceImportProducts(String, CallSettings)
public virtual Operation<ImportProductsResponse, ImportMetadata> PollOnceImportProducts(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of ImportProducts
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Google.LongRunning.Operation<ImportProductsResponse, ImportMetadata> | The result of polling the operation. |
PollOnceImportProductsAsync(String, CallSettings)
public virtual Task<Operation<ImportProductsResponse, ImportMetadata>> PollOnceImportProductsAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
ImportProducts
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Google.LongRunning.Operation<ImportProductsResponse, ImportMetadata>> | A task representing the result of polling the operation. |
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 | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
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)
Updates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
product | Product Required. The product to update/create. If the caller does not have permission to update the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the [Product][google.cloud.retail.v2.Product] to update does not exist, a NOT_FOUND error is returned. |
updateMask | FieldMask Indicates which fields in the provided [Product][google.cloud.retail.v2.Product] to update. The immutable and output only fields are NOT supported. If not set, all supported fields (the fields that are neither immutable nor output only) are updated. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Product | The RPC response. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
Product product = new Product();
FieldMask updateMask = new FieldMask();
// Make the request
Product response = productServiceClient.UpdateProduct(product, updateMask);
UpdateProduct(UpdateProductRequest, CallSettings)
public virtual Product UpdateProduct(UpdateProductRequest request, CallSettings callSettings = null)
Updates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | UpdateProductRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Product | The RPC response. |
// Create client
ProductServiceClient productServiceClient = ProductServiceClient.Create();
// Initialize request argument(s)
UpdateProductRequest request = new UpdateProductRequest
{
Product = new Product(),
UpdateMask = new FieldMask(),
};
// Make the request
Product response = productServiceClient.UpdateProduct(request);
UpdateProductAsync(Product, FieldMask, CallSettings)
public virtual Task<Product> UpdateProductAsync(Product product, FieldMask updateMask, CallSettings callSettings = null)
Updates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
product | Product Required. The product to update/create. If the caller does not have permission to update the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the [Product][google.cloud.retail.v2.Product] to update does not exist, a NOT_FOUND error is returned. |
updateMask | FieldMask Indicates which fields in the provided [Product][google.cloud.retail.v2.Product] to update. The immutable and output only fields are NOT supported. If not set, all supported fields (the fields that are neither immutable nor output only) are updated. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
Product product = new Product();
FieldMask updateMask = new FieldMask();
// Make the request
Product response = await productServiceClient.UpdateProductAsync(product, updateMask);
UpdateProductAsync(Product, FieldMask, CancellationToken)
public virtual Task<Product> UpdateProductAsync(Product product, FieldMask updateMask, CancellationToken cancellationToken)
Updates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
product | Product Required. The product to update/create. If the caller does not have permission to update the [Product][google.cloud.retail.v2.Product], regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the [Product][google.cloud.retail.v2.Product] to update does not exist, a NOT_FOUND error is returned. |
updateMask | FieldMask Indicates which fields in the provided [Product][google.cloud.retail.v2.Product] to update. The immutable and output only fields are NOT supported. If not set, all supported fields (the fields that are neither immutable nor output only) are updated. If an unsupported or unknown field is provided, an INVALID_ARGUMENT error is returned. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
Product product = new Product();
FieldMask updateMask = new FieldMask();
// Make the request
Product response = await productServiceClient.UpdateProductAsync(product, updateMask);
UpdateProductAsync(UpdateProductRequest, CallSettings)
public virtual Task<Product> UpdateProductAsync(UpdateProductRequest request, CallSettings callSettings = null)
Updates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | UpdateProductRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateProductRequest request = new UpdateProductRequest
{
Product = new Product(),
UpdateMask = new FieldMask(),
};
// Make the request
Product response = await productServiceClient.UpdateProductAsync(request);
UpdateProductAsync(UpdateProductRequest, CancellationToken)
public virtual Task<Product> UpdateProductAsync(UpdateProductRequest request, CancellationToken cancellationToken)
Updates a [Product][google.cloud.retail.v2.Product].
Parameters | |
---|---|
Name | Description |
request | UpdateProductRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Product> | A Task containing the RPC response. |
// Create client
ProductServiceClient productServiceClient = await ProductServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateProductRequest request = new UpdateProductRequest
{
Product = new Product(),
UpdateMask = new FieldMask(),
};
// Make the request
Product response = await productServiceClient.UpdateProductAsync(request);