diff --git a/java-retail/README.md b/java-retail/README.md index 050c5401e798..34f208603a6e 100644 --- a/java-retail/README.md +++ b/java-retail/README.md @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-retail.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-retail/2.34.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-retail/2.35.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java index cf0a7707fe8f..fbeaee42bb1d 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CatalogServiceClient.java @@ -58,50 +58,52 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
ListCatalogs

ListCatalogs

Lists all the [Catalog][google.cloud.retail.v2.Catalog]s associated with the project.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listCatalogs(ListCatalogsRequest request) + *
  • listCatalogs(ListCatalogsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listCatalogs(LocationName parent) - *
  • listCatalogs(String parent) + *
  • listCatalogs(LocationName parent) + *

  • listCatalogs(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listCatalogsPagedCallable() - *
  • listCatalogsCallable() + *
  • listCatalogsPagedCallable() + *

  • listCatalogsCallable() *

*
UpdateCatalog

UpdateCatalog

Updates the [Catalog][google.cloud.retail.v2.Catalog]s.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateCatalog(UpdateCatalogRequest request) + *
  • updateCatalog(UpdateCatalogRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateCatalog(Catalog catalog, FieldMask updateMask) + *
  • updateCatalog(Catalog catalog, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateCatalogCallable() + *
  • updateCatalogCallable() *

*
SetDefaultBranch

SetDefaultBranch

Set a specified branch id as default branch. API methods such as [SearchService.Search][google.cloud.retail.v2.SearchService.Search], [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct], [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] will treat requests using "default_branch" to the actual branch id set as default. *

For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as default, setting [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to setting [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/1`. *

Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` as [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to route the traffic to this staging branch. @@ -115,159 +117,158 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • setDefaultBranch(SetDefaultBranchRequest request) + *
  • setDefaultBranch(SetDefaultBranchRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • setDefaultBranch(CatalogName catalog) - *
  • setDefaultBranch(String catalog) + *
  • setDefaultBranch(CatalogName catalog) + *

  • setDefaultBranch(String catalog) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • setDefaultBranchCallable() + *
  • setDefaultBranchCallable() *

*
GetDefaultBranch

GetDefaultBranch

Get which branch is currently default branch set by [CatalogService.SetDefaultBranch][google.cloud.retail.v2.CatalogService.SetDefaultBranch] method under a specified parent catalog.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getDefaultBranch(GetDefaultBranchRequest request) + *
  • getDefaultBranch(GetDefaultBranchRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getDefaultBranch(CatalogName catalog) - *
  • getDefaultBranch(String catalog) + *
  • getDefaultBranch(CatalogName catalog) + *

  • getDefaultBranch(String catalog) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getDefaultBranchCallable() + *
  • getDefaultBranchCallable() *

*
GetCompletionConfig

GetCompletionConfig

Gets a [CompletionConfig][google.cloud.retail.v2.CompletionConfig].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getCompletionConfig(GetCompletionConfigRequest request) + *
  • getCompletionConfig(GetCompletionConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getCompletionConfig(CompletionConfigName name) - *
  • getCompletionConfig(String name) + *
  • getCompletionConfig(CompletionConfigName name) + *

  • getCompletionConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getCompletionConfigCallable() + *
  • getCompletionConfigCallable() *

*
UpdateCompletionConfig

UpdateCompletionConfig

Updates the [CompletionConfig][google.cloud.retail.v2.CompletionConfig]s.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateCompletionConfig(UpdateCompletionConfigRequest request) + *
  • updateCompletionConfig(UpdateCompletionConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateCompletionConfig(CompletionConfig completionConfig, FieldMask updateMask) + *
  • updateCompletionConfig(CompletionConfig completionConfig, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateCompletionConfigCallable() + *
  • updateCompletionConfigCallable() *

*
GetAttributesConfig

GetAttributesConfig

Gets an [AttributesConfig][google.cloud.retail.v2.AttributesConfig].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getAttributesConfig(GetAttributesConfigRequest request) + *
  • getAttributesConfig(GetAttributesConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getAttributesConfig(AttributesConfigName name) - *
  • getAttributesConfig(String name) + *
  • getAttributesConfig(AttributesConfigName name) + *

  • getAttributesConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getAttributesConfigCallable() + *
  • getAttributesConfigCallable() *

*
UpdateAttributesConfig

UpdateAttributesConfig

Updates the [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. *

The catalog attributes in the request will be updated in the catalog, or inserted if they do not exist. Existing catalog attributes not included in the request will remain unchanged. Attributes that are assigned to products, but do not exist at the catalog level, are always included in the response. The product attribute is assigned default values for missing catalog attribute fields, e.g., searchable and dynamic facetable options.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateAttributesConfig(UpdateAttributesConfigRequest request) + *
  • updateAttributesConfig(UpdateAttributesConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateAttributesConfig(AttributesConfig attributesConfig, FieldMask updateMask) + *
  • updateAttributesConfig(AttributesConfig attributesConfig, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateAttributesConfigCallable() + *
  • updateAttributesConfigCallable() *

*
AddCatalogAttribute

AddCatalogAttribute

Adds the specified [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to the [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. *

If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to add already exists, an ALREADY_EXISTS error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addCatalogAttribute(AddCatalogAttributeRequest request) + *
  • addCatalogAttribute(AddCatalogAttributeRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addCatalogAttributeCallable() + *
  • addCatalogAttributeCallable() *

*
RemoveCatalogAttribute

RemoveCatalogAttribute

Removes the specified [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] from the [AttributesConfig][google.cloud.retail.v2.AttributesConfig]. *

If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to remove does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeCatalogAttribute(RemoveCatalogAttributeRequest request) + *
  • removeCatalogAttribute(RemoveCatalogAttributeRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeCatalogAttributeCallable() + *
  • removeCatalogAttributeCallable() *

*
ReplaceCatalogAttribute

ReplaceCatalogAttribute

Replaces the specified [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] in the [AttributesConfig][google.cloud.retail.v2.AttributesConfig] by updating the catalog attribute with the same [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key]. *

If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to replace does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • replaceCatalogAttribute(ReplaceCatalogAttributeRequest request) + *
  • replaceCatalogAttribute(ReplaceCatalogAttributeRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • replaceCatalogAttributeCallable() + *
  • replaceCatalogAttributeCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceClient.java index b8099ab16ae7..aa305e12ceae 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/CompletionServiceClient.java @@ -66,27 +66,29 @@ * close(). * * + * * * * * + * * - * + * * * * * - * + * * * - * *
Methods
MethodDescriptionMethod Variants
CompleteQuery

CompleteQuery

Completes the specified prefix with keyword suggestions. *

This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • completeQuery(CompleteQueryRequest request) + *
  • completeQuery(CompleteQueryRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • completeQueryCallable() + *
  • completeQueryCallable() *

*
ImportCompletionData

ImportCompletionData

Bulk import of processed completion dataset. *

Request processing is asynchronous. Partial updating is not supported. *

The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. @@ -94,16 +96,15 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • importCompletionDataAsync(ImportCompletionDataRequest request) + *
  • importCompletionDataAsync(ImportCompletionDataRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • importCompletionDataOperationCallable() - *
  • importCompletionDataCallable() + *
  • importCompletionDataOperationCallable() + *

  • importCompletionDataCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ControlServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ControlServiceClient.java index 2be7a05a26f8..cbebb6fb4e8e 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ControlServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ControlServiceClient.java @@ -59,109 +59,110 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
CreateControl

CreateControl

Creates a Control. *

If the [Control][google.cloud.retail.v2.Control] to create already exists, an ALREADY_EXISTS error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createControl(CreateControlRequest request) + *
  • createControl(CreateControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • createControl(CatalogName parent, Control control, String controlId) - *
  • createControl(String parent, Control control, String controlId) + *
  • createControl(CatalogName parent, Control control, String controlId) + *

  • createControl(String parent, Control control, String controlId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createControlCallable() + *
  • createControlCallable() *

*
DeleteControl

DeleteControl

Deletes a Control. *

If the [Control][google.cloud.retail.v2.Control] to delete does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteControl(DeleteControlRequest request) + *
  • deleteControl(DeleteControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteControl(ControlName name) - *
  • deleteControl(String name) + *
  • deleteControl(ControlName name) + *

  • deleteControl(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteControlCallable() + *
  • deleteControlCallable() *

*
UpdateControl

UpdateControl

Updates a Control. *

[Control][google.cloud.retail.v2.Control] cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2.Control] to update does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateControl(UpdateControlRequest request) + *
  • updateControl(UpdateControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateControl(Control control, FieldMask updateMask) + *
  • updateControl(Control control, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateControlCallable() + *
  • updateControlCallable() *

*
GetControl

GetControl

Gets a Control.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getControl(GetControlRequest request) + *
  • getControl(GetControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getControl(ControlName name) - *
  • getControl(String name) + *
  • getControl(ControlName name) + *

  • getControl(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getControlCallable() + *
  • getControlCallable() *

*
ListControls

ListControls

Lists all Controls by their parent [Catalog][google.cloud.retail.v2.Catalog].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listControls(ListControlsRequest request) + *
  • listControls(ListControlsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listControls(CatalogName parent) - *
  • listControls(String parent) + *
  • listControls(CatalogName parent) + *

  • listControls(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listControlsPagedCallable() - *
  • listControlsCallable() + *
  • listControlsPagedCallable() + *

  • listControlsCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ModelServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ModelServiceClient.java index 9491ecd97708..167643c2c4d7 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ModelServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ModelServiceClient.java @@ -74,164 +74,165 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
CreateModel

CreateModel

Creates a new model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createModelAsync(CreateModelRequest request) + *
  • createModelAsync(CreateModelRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • createModelAsync(CatalogName parent, Model model) - *
  • createModelAsync(String parent, Model model) + *
  • createModelAsync(CatalogName parent, Model model) + *

  • createModelAsync(String parent, Model model) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createModelOperationCallable() - *
  • createModelCallable() + *
  • createModelOperationCallable() + *

  • createModelCallable() *

*
GetModel

GetModel

Gets a model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getModel(GetModelRequest request) + *
  • getModel(GetModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getModel(ModelName name) - *
  • getModel(String name) + *
  • getModel(ModelName name) + *

  • getModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getModelCallable() + *
  • getModelCallable() *

*
PauseModel

PauseModel

Pauses the training of an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • pauseModel(PauseModelRequest request) + *
  • pauseModel(PauseModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • pauseModel(ModelName name) - *
  • pauseModel(String name) + *
  • pauseModel(ModelName name) + *

  • pauseModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • pauseModelCallable() + *
  • pauseModelCallable() *

*
ResumeModel

ResumeModel

Resumes the training of an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • resumeModel(ResumeModelRequest request) + *
  • resumeModel(ResumeModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • resumeModel(String name) + *
  • resumeModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • resumeModelCallable() + *
  • resumeModelCallable() *

*
DeleteModel

DeleteModel

Deletes an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteModel(DeleteModelRequest request) + *
  • deleteModel(DeleteModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteModel(ModelName name) - *
  • deleteModel(String name) + *
  • deleteModel(ModelName name) + *

  • deleteModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteModelCallable() + *
  • deleteModelCallable() *

*
ListModels

ListModels

Lists all the models linked to this event store.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listModels(ListModelsRequest request) + *
  • listModels(ListModelsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listModels(CatalogName parent) - *
  • listModels(String parent) + *
  • listModels(CatalogName parent) + *

  • listModels(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listModelsPagedCallable() - *
  • listModelsCallable() + *
  • listModelsPagedCallable() + *

  • listModelsCallable() *

*
UpdateModel

UpdateModel

Update of model metadata. Only fields that currently can be updated are: `filtering_option` and `periodic_tuning_state`. If other values are provided, this API method ignores them.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateModel(UpdateModelRequest request) + *
  • updateModel(UpdateModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateModel(Model model, FieldMask updateMask) + *
  • updateModel(Model model, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateModelCallable() + *
  • updateModelCallable() *

*
TuneModel

TuneModel

Tunes an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • tuneModelAsync(TuneModelRequest request) + *
  • tuneModelAsync(TuneModelRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • tuneModelAsync(ModelName name) - *
  • tuneModelAsync(String name) + *
  • tuneModelAsync(ModelName name) + *

  • tuneModelAsync(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • tuneModelOperationCallable() - *
  • tuneModelCallable() + *
  • tuneModelOperationCallable() + *

  • tuneModelCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/PredictionServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/PredictionServiceClient.java index e0b87732140b..761ef00ad498 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/PredictionServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/PredictionServiceClient.java @@ -58,25 +58,26 @@ * close(). * * + * * * * * + * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
Predict

Predict

Makes a recommendation prediction.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • predict(PredictRequest request) + *
  • predict(PredictRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • predictCallable() + *
  • predictCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceClient.java index c323635ae7d6..aa883df024b4 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ProductServiceClient.java @@ -65,124 +65,126 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * - * *
Methods
MethodDescriptionMethod Variants
CreateProduct

CreateProduct

Creates a [Product][google.cloud.retail.v2.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createProduct(CreateProductRequest request) + *
  • createProduct(CreateProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • createProduct(BranchName parent, Product product, String productId) - *
  • createProduct(String parent, Product product, String productId) + *
  • createProduct(BranchName parent, Product product, String productId) + *

  • createProduct(String parent, Product product, String productId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createProductCallable() + *
  • createProductCallable() *

*
GetProduct

GetProduct

Gets a [Product][google.cloud.retail.v2.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getProduct(GetProductRequest request) + *
  • getProduct(GetProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getProduct(ProductName name) - *
  • getProduct(String name) + *
  • getProduct(ProductName name) + *

  • getProduct(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getProductCallable() + *
  • getProductCallable() *

*
ListProducts

ListProducts

Gets a list of [Product][google.cloud.retail.v2.Product]s.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listProducts(ListProductsRequest request) + *
  • listProducts(ListProductsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listProducts(BranchName parent) - *
  • listProducts(String parent) + *
  • listProducts(BranchName parent) + *

  • listProducts(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listProductsPagedCallable() - *
  • listProductsCallable() + *
  • listProductsPagedCallable() + *

  • listProductsCallable() *

*
UpdateProduct

UpdateProduct

Updates a [Product][google.cloud.retail.v2.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateProduct(UpdateProductRequest request) + *
  • updateProduct(UpdateProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateProduct(Product product, FieldMask updateMask) + *
  • updateProduct(Product product, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateProductCallable() + *
  • updateProductCallable() *

*
DeleteProduct

DeleteProduct

Deletes a [Product][google.cloud.retail.v2.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteProduct(DeleteProductRequest request) + *
  • deleteProduct(DeleteProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteProduct(ProductName name) - *
  • deleteProduct(String name) + *
  • deleteProduct(ProductName name) + *

  • deleteProduct(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteProductCallable() + *
  • deleteProductCallable() *

*
ImportProducts

ImportProducts

Bulk import of multiple [Product][google.cloud.retail.v2.Product]s. *

Request processing may be synchronous. 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.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • importProductsAsync(ImportProductsRequest request) + *
  • importProductsAsync(ImportProductsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • importProductsOperationCallable() - *
  • importProductsCallable() + *
  • importProductsOperationCallable() + *

  • importProductsCallable() *

*
SetInventory

SetInventory

Updates inventory information for a [Product][google.cloud.retail.v2.Product] while respecting the last update timestamps of each inventory field. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. *

When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] request. @@ -194,21 +196,21 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • setInventoryAsync(SetInventoryRequest request) + *
  • setInventoryAsync(SetInventoryRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • setInventoryAsync(Product inventory, FieldMask setMask) + *
  • setInventoryAsync(Product inventory, FieldMask setMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • setInventoryOperationCallable() - *
  • setInventoryCallable() + *
  • setInventoryOperationCallable() + *

  • setInventoryCallable() *

*
AddFulfillmentPlaces

AddFulfillmentPlaces

It is recommended to use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces]. [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. *

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. @@ -217,22 +219,22 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request) + *
  • addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • addFulfillmentPlacesAsync(ProductName product) - *
  • addFulfillmentPlacesAsync(String product) + *
  • addFulfillmentPlacesAsync(ProductName product) + *

  • addFulfillmentPlacesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addFulfillmentPlacesOperationCallable() - *
  • addFulfillmentPlacesCallable() + *
  • addFulfillmentPlacesOperationCallable() + *

  • addFulfillmentPlacesCallable() *

*
RemoveFulfillmentPlaces

RemoveFulfillmentPlaces

It is recommended to use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces]. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. *

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2.FulfillmentInfo.place_ids]. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. @@ -241,22 +243,22 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request) + *
  • removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • removeFulfillmentPlacesAsync(ProductName product) - *
  • removeFulfillmentPlacesAsync(String product) + *
  • removeFulfillmentPlacesAsync(ProductName product) + *

  • removeFulfillmentPlacesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeFulfillmentPlacesOperationCallable() - *
  • removeFulfillmentPlacesCallable() + *
  • removeFulfillmentPlacesOperationCallable() + *

  • removeFulfillmentPlacesCallable() *

*
AddLocalInventories

AddLocalInventories

Updates local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places, while respecting the last update timestamps of each inventory field. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. *

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories. @@ -265,22 +267,22 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addLocalInventoriesAsync(AddLocalInventoriesRequest request) + *
  • addLocalInventoriesAsync(AddLocalInventoriesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • addLocalInventoriesAsync(ProductName product) - *
  • addLocalInventoriesAsync(String product) + *
  • addLocalInventoriesAsync(ProductName product) + *

  • addLocalInventoriesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addLocalInventoriesOperationCallable() - *
  • addLocalInventoriesCallable() + *
  • addLocalInventoriesOperationCallable() + *

  • addLocalInventoriesCallable() *

*
RemoveLocalInventories

RemoveLocalInventories

Remove local inventory information for a [Product][google.cloud.retail.v2.Product] at a list of places at a removal timestamp. *

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts]. *

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories. @@ -289,21 +291,20 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeLocalInventoriesAsync(RemoveLocalInventoriesRequest request) + *
  • removeLocalInventoriesAsync(RemoveLocalInventoriesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • removeLocalInventoriesAsync(ProductName product) - *
  • removeLocalInventoriesAsync(String product) + *
  • removeLocalInventoriesAsync(ProductName product) + *

  • removeLocalInventoriesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeLocalInventoriesOperationCallable() - *
  • removeLocalInventoriesCallable() + *
  • removeLocalInventoriesOperationCallable() + *

  • removeLocalInventoriesCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceClient.java index 282dc2154d54..a73ab9ab4953 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/SearchServiceClient.java @@ -84,27 +84,28 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
Search

Search

Performs a search. *

This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • search(SearchRequest request) + *
  • search(SearchRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • searchPagedCallable() - *
  • searchCallable() + *
  • searchPagedCallable() + *

  • searchCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ServingConfigServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ServingConfigServiceClient.java index 9e8cb5277e5d..3d35e6c0a9f0 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ServingConfigServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/ServingConfigServiceClient.java @@ -62,147 +62,148 @@ * calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
CreateServingConfig

CreateServingConfig

Creates a ServingConfig. *

A maximum of 100 [ServingConfig][google.cloud.retail.v2.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2.Catalog], otherwise a FAILED_PRECONDITION error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createServingConfig(CreateServingConfigRequest request) + *
  • createServingConfig(CreateServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • createServingConfig(CatalogName parent, ServingConfig servingConfig, String servingConfigId) - *
  • createServingConfig(String parent, ServingConfig servingConfig, String servingConfigId) + *
  • createServingConfig(CatalogName parent, ServingConfig servingConfig, String servingConfigId) + *

  • createServingConfig(String parent, ServingConfig servingConfig, String servingConfigId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createServingConfigCallable() + *
  • createServingConfigCallable() *

*
DeleteServingConfig

DeleteServingConfig

Deletes a ServingConfig. *

Returns a NotFound error if the ServingConfig does not exist.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteServingConfig(DeleteServingConfigRequest request) + *
  • deleteServingConfig(DeleteServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteServingConfig(ServingConfigName name) - *
  • deleteServingConfig(String name) + *
  • deleteServingConfig(ServingConfigName name) + *

  • deleteServingConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteServingConfigCallable() + *
  • deleteServingConfigCallable() *

*
UpdateServingConfig

UpdateServingConfig

Updates a ServingConfig.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateServingConfig(UpdateServingConfigRequest request) + *
  • updateServingConfig(UpdateServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateServingConfig(ServingConfig servingConfig, FieldMask updateMask) + *
  • updateServingConfig(ServingConfig servingConfig, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateServingConfigCallable() + *
  • updateServingConfigCallable() *

*
GetServingConfig

GetServingConfig

Gets a ServingConfig. *

Returns a NotFound error if the ServingConfig does not exist.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getServingConfig(GetServingConfigRequest request) + *
  • getServingConfig(GetServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getServingConfig(ServingConfigName name) - *
  • getServingConfig(String name) + *
  • getServingConfig(ServingConfigName name) + *

  • getServingConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getServingConfigCallable() + *
  • getServingConfigCallable() *

*
ListServingConfigs

ListServingConfigs

Lists all ServingConfigs linked to this catalog.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listServingConfigs(ListServingConfigsRequest request) + *
  • listServingConfigs(ListServingConfigsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listServingConfigs(CatalogName parent) - *
  • listServingConfigs(String parent) + *
  • listServingConfigs(CatalogName parent) + *

  • listServingConfigs(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listServingConfigsPagedCallable() - *
  • listServingConfigsCallable() + *
  • listServingConfigsPagedCallable() + *

  • listServingConfigsCallable() *

*
AddControl

AddControl

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addControl(AddControlRequest request) + *
  • addControl(AddControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • addControl(ServingConfigName servingConfig) - *
  • addControl(String servingConfig) + *
  • addControl(ServingConfigName servingConfig) + *

  • addControl(String servingConfig) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addControlCallable() + *
  • addControlCallable() *

*
RemoveControl

RemoveControl

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeControl(RemoveControlRequest request) + *
  • removeControl(RemoveControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • removeControl(ServingConfigName servingConfig) - *
  • removeControl(String servingConfig) + *
  • removeControl(ServingConfigName servingConfig) + *

  • removeControl(String servingConfig) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeControlCallable() + *
  • removeControlCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/UserEventServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/UserEventServiceClient.java index 9e096de19025..0d398b0ee178 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/UserEventServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/UserEventServiceClient.java @@ -59,86 +59,87 @@ * close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
WriteUserEvent

WriteUserEvent

Writes a single user event.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • writeUserEvent(WriteUserEventRequest request) + *
  • writeUserEvent(WriteUserEventRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • writeUserEventCallable() + *
  • writeUserEventCallable() *

*
CollectUserEvent

CollectUserEvent

Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain. *

This method is used only by the Retail API JavaScript pixel and Google Tag Manager. Users should not call this method directly.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • collectUserEvent(CollectUserEventRequest request) + *
  • collectUserEvent(CollectUserEventRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • collectUserEventCallable() + *
  • collectUserEventCallable() *

*
PurgeUserEvents

PurgeUserEvents

Deletes permanently all user events specified by the filter provided. Depending on the number of events specified by the filter, this operation could take hours or days to complete. To test a filter, use the list command first.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • purgeUserEventsAsync(PurgeUserEventsRequest request) + *
  • purgeUserEventsAsync(PurgeUserEventsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • purgeUserEventsOperationCallable() - *
  • purgeUserEventsCallable() + *
  • purgeUserEventsOperationCallable() + *

  • purgeUserEventsCallable() *

*
ImportUserEvents

ImportUserEvents

Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. *

`Operation.response` is of type `ImportResponse`. Note that it is possible for a subset of the items to be successfully inserted. `Operation.metadata` is of type `ImportMetadata`.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • importUserEventsAsync(ImportUserEventsRequest request) + *
  • importUserEventsAsync(ImportUserEventsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • importUserEventsOperationCallable() - *
  • importUserEventsCallable() + *
  • importUserEventsOperationCallable() + *

  • importUserEventsCallable() *

*
RejoinUserEvents

RejoinUserEvents

Starts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from the catalog when the user event is ingested. These events are stored as unjoined events with limited usage on training and serving. You can use this method to start a join operation on specified events with the latest version of product catalog. You can also use this method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • rejoinUserEventsAsync(RejoinUserEventsRequest request) + *
  • rejoinUserEventsAsync(RejoinUserEventsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • rejoinUserEventsOperationCallable() - *
  • rejoinUserEventsCallable() + *
  • rejoinUserEventsOperationCallable() + *

  • rejoinUserEventsCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStubSettings.java index e895878b22b4..1c4929675fb2 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CatalogServiceStubSettings.java @@ -267,6 +267,15 @@ public CatalogServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -505,7 +514,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -518,7 +526,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -664,6 +671,15 @@ public UnaryCallSettings.Builder setDefaultBranc return replaceCatalogAttributeSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public CatalogServiceStubSettings build() throws IOException { return new CatalogServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStubSettings.java index 4e7aad45bd83..15a55303008a 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/CompletionServiceStubSettings.java @@ -138,6 +138,15 @@ public CompletionServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -319,7 +328,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -332,7 +340,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -414,6 +421,15 @@ public Builder applyToAllUnaryMethods( return importCompletionDataOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public CompletionServiceStubSettings build() throws IOException { return new CompletionServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ControlServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ControlServiceStubSettings.java index e4c0a8f2bad1..199e4df45f5d 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ControlServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ControlServiceStubSettings.java @@ -205,6 +205,15 @@ public ControlServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -385,7 +394,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -398,7 +406,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -476,6 +483,15 @@ public UnaryCallSettings.Builder getControlSettings( return listControlsSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ControlServiceStubSettings build() throws IOException { return new ControlServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ModelServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ModelServiceStubSettings.java index 1b2fdb4c1fd5..a418e62876b1 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ModelServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ModelServiceStubSettings.java @@ -250,6 +250,15 @@ public ModelServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -472,7 +481,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -485,7 +493,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -654,6 +661,15 @@ public UnaryCallSettings.Builder tuneModelSettings( return tuneModelOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ModelServiceStubSettings build() throws IOException { return new ModelServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/PredictionServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/PredictionServiceStubSettings.java index 72cfe6542cd4..0629839ba739 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/PredictionServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/PredictionServiceStubSettings.java @@ -112,6 +112,15 @@ public PredictionServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -277,7 +286,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -290,7 +298,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -326,6 +333,15 @@ public UnaryCallSettings.Builder predictSetting return predictSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public PredictionServiceStubSettings build() throws IOException { return new PredictionServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStubSettings.java index e4760c664a70..88171b1f4bf6 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ProductServiceStubSettings.java @@ -336,6 +336,15 @@ public ProductServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -634,7 +643,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -647,7 +655,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -999,6 +1006,15 @@ public UnaryCallSettings.Builder setInventorySet return removeLocalInventoriesOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ProductServiceStubSettings build() throws IOException { return new ProductServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStubSettings.java index 825ac3fc206f..01f2ac7d6b19 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/SearchServiceStubSettings.java @@ -173,6 +173,15 @@ public SearchServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -339,7 +348,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -352,7 +360,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -389,6 +396,15 @@ public Builder applyToAllUnaryMethods( return searchSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public SearchServiceStubSettings build() throws IOException { return new SearchServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ServingConfigServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ServingConfigServiceStubSettings.java index 6ef5575e090a..5a998d596a3f 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ServingConfigServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/ServingConfigServiceStubSettings.java @@ -234,6 +234,15 @@ public ServingConfigServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -432,7 +441,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -445,7 +453,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -547,6 +554,15 @@ public UnaryCallSettings.Builder removeCont return removeControlSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ServingConfigServiceStubSettings build() throws IOException { return new ServingConfigServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/UserEventServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/UserEventServiceStubSettings.java index d75ced950d37..4baa6e91ac06 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/UserEventServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2/stub/UserEventServiceStubSettings.java @@ -179,6 +179,15 @@ public UserEventServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -425,7 +434,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -438,7 +446,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -615,6 +622,15 @@ public UnaryCallSettings.Builder purgeUserEve return rejoinUserEventsOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public UserEventServiceStubSettings build() throws IOException { return new UserEventServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceClient.java new file mode 100644 index 000000000000..6953426977fd --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceClient.java @@ -0,0 +1,352 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.stub.AnalyticsServiceStub; +import com.google.cloud.retail.v2alpha.stub.AnalyticsServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for managing & accessing retail search business metric. Retail + * recommendation business metric is currently not available. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) {
+ *   ExportAnalyticsMetricsRequest request =
+ *       ExportAnalyticsMetricsRequest.newBuilder()
+ *           .setCatalog("catalog555704345")
+ *           .setOutputConfig(OutputConfig.newBuilder().build())
+ *           .setFilter("filter-1274492040")
+ *           .build();
+ *   ExportAnalyticsMetricsResponse response =
+ *       analyticsServiceClient.exportAnalyticsMetricsAsync(request).get();
+ * }
+ * }
+ * + *

Note: close() needs to be called on the AnalyticsServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

ExportAnalyticsMetrics

Exports analytics metrics. + *

`Operation.response` is of type `ExportAnalyticsMetricsResponse`. `Operation.metadata` is of type `ExportMetadata`.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • exportAnalyticsMetricsAsync(ExportAnalyticsMetricsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • exportAnalyticsMetricsOperationCallable() + *

  • exportAnalyticsMetricsCallable() + *

+ *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of AnalyticsServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsServiceSettings analyticsServiceSettings =
+ *     AnalyticsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AnalyticsServiceClient analyticsServiceClient =
+ *     AnalyticsServiceClient.create(analyticsServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsServiceSettings analyticsServiceSettings =
+ *     AnalyticsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AnalyticsServiceClient analyticsServiceClient =
+ *     AnalyticsServiceClient.create(analyticsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsServiceSettings analyticsServiceSettings =
+ *     AnalyticsServiceSettings.newHttpJsonBuilder().build();
+ * AnalyticsServiceClient analyticsServiceClient =
+ *     AnalyticsServiceClient.create(analyticsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class AnalyticsServiceClient implements BackgroundResource { + private final AnalyticsServiceSettings settings; + private final AnalyticsServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of AnalyticsServiceClient with default settings. */ + public static final AnalyticsServiceClient create() throws IOException { + return create(AnalyticsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AnalyticsServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final AnalyticsServiceClient create(AnalyticsServiceSettings settings) + throws IOException { + return new AnalyticsServiceClient(settings); + } + + /** + * Constructs an instance of AnalyticsServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(AnalyticsServiceSettings). + */ + public static final AnalyticsServiceClient create(AnalyticsServiceStub stub) { + return new AnalyticsServiceClient(stub); + } + + /** + * Constructs an instance of AnalyticsServiceClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected AnalyticsServiceClient(AnalyticsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AnalyticsServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected AnalyticsServiceClient(AnalyticsServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final AnalyticsServiceSettings getSettings() { + return settings; + } + + public AnalyticsServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports analytics metrics. + * + *

`Operation.response` is of type `ExportAnalyticsMetricsResponse`. `Operation.metadata` is of + * type `ExportMetadata`. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) {
+   *   ExportAnalyticsMetricsRequest request =
+   *       ExportAnalyticsMetricsRequest.newBuilder()
+   *           .setCatalog("catalog555704345")
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ExportAnalyticsMetricsResponse response =
+   *       analyticsServiceClient.exportAnalyticsMetricsAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + exportAnalyticsMetricsAsync(ExportAnalyticsMetricsRequest request) { + return exportAnalyticsMetricsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports analytics metrics. + * + *

`Operation.response` is of type `ExportAnalyticsMetricsResponse`. `Operation.metadata` is of + * type `ExportMetadata`. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) {
+   *   ExportAnalyticsMetricsRequest request =
+   *       ExportAnalyticsMetricsRequest.newBuilder()
+   *           .setCatalog("catalog555704345")
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   OperationFuture future =
+   *       analyticsServiceClient.exportAnalyticsMetricsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ExportAnalyticsMetricsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable() { + return stub.exportAnalyticsMetricsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports analytics metrics. + * + *

`Operation.response` is of type `ExportAnalyticsMetricsResponse`. `Operation.metadata` is of + * type `ExportMetadata`. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) {
+   *   ExportAnalyticsMetricsRequest request =
+   *       ExportAnalyticsMetricsRequest.newBuilder()
+   *           .setCatalog("catalog555704345")
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsServiceClient.exportAnalyticsMetricsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + exportAnalyticsMetricsCallable() { + return stub.exportAnalyticsMetricsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceSettings.java new file mode 100644 index 000000000000..bcd2c5ec65dd --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceSettings.java @@ -0,0 +1,225 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2alpha.stub.AnalyticsServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AnalyticsServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of exportAnalyticsMetrics to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsServiceSettings.Builder analyticsServiceSettingsBuilder =
+ *     AnalyticsServiceSettings.newBuilder();
+ * analyticsServiceSettingsBuilder
+ *     .exportAnalyticsMetricsSettings()
+ *     .setRetrySettings(
+ *         analyticsServiceSettingsBuilder
+ *             .exportAnalyticsMetricsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AnalyticsServiceSettings analyticsServiceSettings = analyticsServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AnalyticsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to exportAnalyticsMetrics. */ + public UnaryCallSettings + exportAnalyticsMetricsSettings() { + return ((AnalyticsServiceStubSettings) getStubSettings()).exportAnalyticsMetricsSettings(); + } + + /** Returns the object with the settings used for calls to exportAnalyticsMetrics. */ + public OperationCallSettings< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings() { + return ((AnalyticsServiceStubSettings) getStubSettings()) + .exportAnalyticsMetricsOperationSettings(); + } + + public static final AnalyticsServiceSettings create(AnalyticsServiceStubSettings stub) + throws IOException { + return new AnalyticsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AnalyticsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AnalyticsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AnalyticsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AnalyticsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AnalyticsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return AnalyticsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AnalyticsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AnalyticsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AnalyticsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AnalyticsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AnalyticsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(AnalyticsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AnalyticsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AnalyticsServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(AnalyticsServiceStubSettings.newHttpJsonBuilder()); + } + + public AnalyticsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((AnalyticsServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to exportAnalyticsMetrics. */ + public UnaryCallSettings.Builder + exportAnalyticsMetricsSettings() { + return getStubSettingsBuilder().exportAnalyticsMetricsSettings(); + } + + /** Returns the builder for the settings used for calls to exportAnalyticsMetrics. */ + public OperationCallSettings.Builder< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings() { + return getStubSettingsBuilder().exportAnalyticsMetricsOperationSettings(); + } + + @Override + public AnalyticsServiceSettings build() throws IOException { + return new AnalyticsServiceSettings(this); + } + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceClient.java index d4a195d88d9f..2bdf986c9148 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CatalogServiceClient.java @@ -59,50 +59,52 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
ListCatalogs

ListCatalogs

Lists all the [Catalog][google.cloud.retail.v2alpha.Catalog]s associated with the project.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listCatalogs(ListCatalogsRequest request) + *
  • listCatalogs(ListCatalogsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listCatalogs(LocationName parent) - *
  • listCatalogs(String parent) + *
  • listCatalogs(LocationName parent) + *

  • listCatalogs(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listCatalogsPagedCallable() - *
  • listCatalogsCallable() + *
  • listCatalogsPagedCallable() + *

  • listCatalogsCallable() *

*
UpdateCatalog

UpdateCatalog

Updates the [Catalog][google.cloud.retail.v2alpha.Catalog]s.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateCatalog(UpdateCatalogRequest request) + *
  • updateCatalog(UpdateCatalogRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateCatalog(Catalog catalog, FieldMask updateMask) + *
  • updateCatalog(Catalog catalog, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateCatalogCallable() + *
  • updateCatalogCallable() *

*
SetDefaultBranch

SetDefaultBranch

Set a specified branch id as default branch. API methods such as [SearchService.Search][google.cloud.retail.v2alpha.SearchService.Search], [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct], [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts] will treat requests using "default_branch" to the actual branch id set as default. *

For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as default, setting [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to setting [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/1`. *

Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` as [SearchRequest.branch][google.cloud.retail.v2alpha.SearchRequest.branch] to route the traffic to this staging branch. @@ -116,173 +118,172 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • setDefaultBranch(SetDefaultBranchRequest request) + *
  • setDefaultBranch(SetDefaultBranchRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • setDefaultBranch(CatalogName catalog) - *
  • setDefaultBranch(String catalog) + *
  • setDefaultBranch(CatalogName catalog) + *

  • setDefaultBranch(String catalog) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • setDefaultBranchCallable() + *
  • setDefaultBranchCallable() *

*
GetDefaultBranch

GetDefaultBranch

Get which branch is currently default branch set by [CatalogService.SetDefaultBranch][google.cloud.retail.v2alpha.CatalogService.SetDefaultBranch] method under a specified parent catalog.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getDefaultBranch(GetDefaultBranchRequest request) + *
  • getDefaultBranch(GetDefaultBranchRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getDefaultBranch(CatalogName catalog) - *
  • getDefaultBranch(String catalog) + *
  • getDefaultBranch(CatalogName catalog) + *

  • getDefaultBranch(String catalog) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getDefaultBranchCallable() + *
  • getDefaultBranchCallable() *

*
GetCompletionConfig

GetCompletionConfig

Gets a [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getCompletionConfig(GetCompletionConfigRequest request) + *
  • getCompletionConfig(GetCompletionConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getCompletionConfig(CompletionConfigName name) - *
  • getCompletionConfig(String name) + *
  • getCompletionConfig(CompletionConfigName name) + *

  • getCompletionConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getCompletionConfigCallable() + *
  • getCompletionConfigCallable() *

*
UpdateCompletionConfig

UpdateCompletionConfig

Updates the [CompletionConfig][google.cloud.retail.v2alpha.CompletionConfig]s.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateCompletionConfig(UpdateCompletionConfigRequest request) + *
  • updateCompletionConfig(UpdateCompletionConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateCompletionConfig(CompletionConfig completionConfig, FieldMask updateMask) + *
  • updateCompletionConfig(CompletionConfig completionConfig, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateCompletionConfigCallable() + *
  • updateCompletionConfigCallable() *

*
GetAttributesConfig

GetAttributesConfig

Gets an [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getAttributesConfig(GetAttributesConfigRequest request) + *
  • getAttributesConfig(GetAttributesConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getAttributesConfig(AttributesConfigName name) - *
  • getAttributesConfig(String name) + *
  • getAttributesConfig(AttributesConfigName name) + *

  • getAttributesConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getAttributesConfigCallable() + *
  • getAttributesConfigCallable() *

*
UpdateAttributesConfig

UpdateAttributesConfig

Updates the [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. *

The catalog attributes in the request will be updated in the catalog, or inserted if they do not exist. Existing catalog attributes not included in the request will remain unchanged. Attributes that are assigned to products, but do not exist at the catalog level, are always included in the response. The product attribute is assigned default values for missing catalog attribute fields, e.g., searchable and dynamic facetable options.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateAttributesConfig(UpdateAttributesConfigRequest request) + *
  • updateAttributesConfig(UpdateAttributesConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateAttributesConfig(AttributesConfig attributesConfig, FieldMask updateMask) + *
  • updateAttributesConfig(AttributesConfig attributesConfig, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateAttributesConfigCallable() + *
  • updateAttributesConfigCallable() *

*
AddCatalogAttribute

AddCatalogAttribute

Adds the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to the [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. *

If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to add already exists, an ALREADY_EXISTS error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addCatalogAttribute(AddCatalogAttributeRequest request) + *
  • addCatalogAttribute(AddCatalogAttributeRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addCatalogAttributeCallable() + *
  • addCatalogAttributeCallable() *

*
RemoveCatalogAttribute

RemoveCatalogAttribute

Removes the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] from the [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig]. *

If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to remove does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeCatalogAttribute(RemoveCatalogAttributeRequest request) + *
  • removeCatalogAttribute(RemoveCatalogAttributeRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeCatalogAttributeCallable() + *
  • removeCatalogAttributeCallable() *

*
BatchRemoveCatalogAttributes

BatchRemoveCatalogAttributes

Removes all specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute]s from the [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • batchRemoveCatalogAttributes(BatchRemoveCatalogAttributesRequest request) + *
  • batchRemoveCatalogAttributes(BatchRemoveCatalogAttributesRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • batchRemoveCatalogAttributesCallable() + *
  • batchRemoveCatalogAttributesCallable() *

*
ReplaceCatalogAttribute

ReplaceCatalogAttribute

Replaces the specified [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] in the [AttributesConfig][google.cloud.retail.v2alpha.AttributesConfig] by updating the catalog attribute with the same [CatalogAttribute.key][google.cloud.retail.v2alpha.CatalogAttribute.key]. *

If the [CatalogAttribute][google.cloud.retail.v2alpha.CatalogAttribute] to replace does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • replaceCatalogAttribute(ReplaceCatalogAttributeRequest request) + *
  • replaceCatalogAttribute(ReplaceCatalogAttributeRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • replaceCatalogAttributeCallable() + *
  • replaceCatalogAttributeCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceClient.java index 7e80f190d03f..a3cfa2007bf6 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/CompletionServiceClient.java @@ -67,27 +67,29 @@ * close(). * * + * * * * * + * * - * + * * * * * - * + * * * - * *
Methods
MethodDescriptionMethod Variants
CompleteQuery

CompleteQuery

Completes the specified prefix with keyword suggestions. *

This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • completeQuery(CompleteQueryRequest request) + *
  • completeQuery(CompleteQueryRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • completeQueryCallable() + *
  • completeQueryCallable() *

*
ImportCompletionData

ImportCompletionData

Bulk import of processed completion dataset. *

Request processing is asynchronous. Partial updating is not supported. *

The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. @@ -95,16 +97,15 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • importCompletionDataAsync(ImportCompletionDataRequest request) + *
  • importCompletionDataAsync(ImportCompletionDataRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • importCompletionDataOperationCallable() - *
  • importCompletionDataCallable() + *
  • importCompletionDataOperationCallable() + *

  • importCompletionDataCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceClient.java index 060ed6295dc1..eae12d56986b 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ControlServiceClient.java @@ -60,109 +60,110 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
CreateControl

CreateControl

Creates a Control. *

If the [Control][google.cloud.retail.v2alpha.Control] to create already exists, an ALREADY_EXISTS error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createControl(CreateControlRequest request) + *
  • createControl(CreateControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • createControl(CatalogName parent, Control control, String controlId) - *
  • createControl(String parent, Control control, String controlId) + *
  • createControl(CatalogName parent, Control control, String controlId) + *

  • createControl(String parent, Control control, String controlId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createControlCallable() + *
  • createControlCallable() *

*
DeleteControl

DeleteControl

Deletes a Control. *

If the [Control][google.cloud.retail.v2alpha.Control] to delete does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteControl(DeleteControlRequest request) + *
  • deleteControl(DeleteControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteControl(ControlName name) - *
  • deleteControl(String name) + *
  • deleteControl(ControlName name) + *

  • deleteControl(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteControlCallable() + *
  • deleteControlCallable() *

*
UpdateControl

UpdateControl

Updates a Control. *

[Control][google.cloud.retail.v2alpha.Control] cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2alpha.Control] to update does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateControl(UpdateControlRequest request) + *
  • updateControl(UpdateControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateControl(Control control, FieldMask updateMask) + *
  • updateControl(Control control, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateControlCallable() + *
  • updateControlCallable() *

*
GetControl

GetControl

Gets a Control.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getControl(GetControlRequest request) + *
  • getControl(GetControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getControl(ControlName name) - *
  • getControl(String name) + *
  • getControl(ControlName name) + *

  • getControl(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getControlCallable() + *
  • getControlCallable() *

*
ListControls

ListControls

Lists all Controls by their parent [Catalog][google.cloud.retail.v2alpha.Catalog].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listControls(ListControlsRequest request) + *
  • listControls(ListControlsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listControls(CatalogName parent) - *
  • listControls(String parent) + *
  • listControls(CatalogName parent) + *

  • listControls(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listControlsPagedCallable() - *
  • listControlsCallable() + *
  • listControlsPagedCallable() + *

  • listControlsCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterAccountLinkServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterAccountLinkServiceClient.java index 010bb21bb3f4..1e155f328e30 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterAccountLinkServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/MerchantCenterAccountLinkServiceClient.java @@ -56,69 +56,70 @@ * automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
ListMerchantCenterAccountLinks

ListMerchantCenterAccountLinks

Lists all [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]s under the specified parent [Catalog][google.cloud.retail.v2alpha.Catalog].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listMerchantCenterAccountLinks(ListMerchantCenterAccountLinksRequest request) + *
  • listMerchantCenterAccountLinks(ListMerchantCenterAccountLinksRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listMerchantCenterAccountLinks(CatalogName parent) - *
  • listMerchantCenterAccountLinks(String parent) + *
  • listMerchantCenterAccountLinks(CatalogName parent) + *

  • listMerchantCenterAccountLinks(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listMerchantCenterAccountLinksCallable() + *
  • listMerchantCenterAccountLinksCallable() *

*
CreateMerchantCenterAccountLink

CreateMerchantCenterAccountLink

Creates a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createMerchantCenterAccountLinkAsync(CreateMerchantCenterAccountLinkRequest request) + *
  • createMerchantCenterAccountLinkAsync(CreateMerchantCenterAccountLinkRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • createMerchantCenterAccountLinkAsync(CatalogName parent, MerchantCenterAccountLink merchantCenterAccountLink) - *
  • createMerchantCenterAccountLinkAsync(String parent, MerchantCenterAccountLink merchantCenterAccountLink) + *
  • createMerchantCenterAccountLinkAsync(CatalogName parent, MerchantCenterAccountLink merchantCenterAccountLink) + *

  • createMerchantCenterAccountLinkAsync(String parent, MerchantCenterAccountLink merchantCenterAccountLink) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createMerchantCenterAccountLinkOperationCallable() - *
  • createMerchantCenterAccountLinkCallable() + *
  • createMerchantCenterAccountLinkOperationCallable() + *

  • createMerchantCenterAccountLinkCallable() *

*
DeleteMerchantCenterAccountLink

DeleteMerchantCenterAccountLink

Deletes a [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink]. If the [MerchantCenterAccountLink][google.cloud.retail.v2alpha.MerchantCenterAccountLink] to delete does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteMerchantCenterAccountLink(DeleteMerchantCenterAccountLinkRequest request) + *
  • deleteMerchantCenterAccountLink(DeleteMerchantCenterAccountLinkRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteMerchantCenterAccountLink(MerchantCenterAccountLinkName name) - *
  • deleteMerchantCenterAccountLink(String name) + *
  • deleteMerchantCenterAccountLink(MerchantCenterAccountLinkName name) + *

  • deleteMerchantCenterAccountLink(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteMerchantCenterAccountLinkCallable() + *
  • deleteMerchantCenterAccountLinkCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ModelServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ModelServiceClient.java index da3111b78270..ed82ddc9f202 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ModelServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ModelServiceClient.java @@ -74,164 +74,165 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
CreateModel

CreateModel

Creates a new model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createModelAsync(CreateModelRequest request) + *
  • createModelAsync(CreateModelRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • createModelAsync(CatalogName parent, Model model) - *
  • createModelAsync(String parent, Model model) + *
  • createModelAsync(CatalogName parent, Model model) + *

  • createModelAsync(String parent, Model model) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createModelOperationCallable() - *
  • createModelCallable() + *
  • createModelOperationCallable() + *

  • createModelCallable() *

*
GetModel

GetModel

Gets a model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getModel(GetModelRequest request) + *
  • getModel(GetModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getModel(ModelName name) - *
  • getModel(String name) + *
  • getModel(ModelName name) + *

  • getModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getModelCallable() + *
  • getModelCallable() *

*
PauseModel

PauseModel

Pauses the training of an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • pauseModel(PauseModelRequest request) + *
  • pauseModel(PauseModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • pauseModel(ModelName name) - *
  • pauseModel(String name) + *
  • pauseModel(ModelName name) + *

  • pauseModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • pauseModelCallable() + *
  • pauseModelCallable() *

*
ResumeModel

ResumeModel

Resumes the training of an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • resumeModel(ResumeModelRequest request) + *
  • resumeModel(ResumeModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • resumeModel(String name) + *
  • resumeModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • resumeModelCallable() + *
  • resumeModelCallable() *

*
DeleteModel

DeleteModel

Deletes an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteModel(DeleteModelRequest request) + *
  • deleteModel(DeleteModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteModel(ModelName name) - *
  • deleteModel(String name) + *
  • deleteModel(ModelName name) + *

  • deleteModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteModelCallable() + *
  • deleteModelCallable() *

*
ListModels

ListModels

Lists all the models linked to this event store.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listModels(ListModelsRequest request) + *
  • listModels(ListModelsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listModels(CatalogName parent) - *
  • listModels(String parent) + *
  • listModels(CatalogName parent) + *

  • listModels(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listModelsPagedCallable() - *
  • listModelsCallable() + *
  • listModelsPagedCallable() + *

  • listModelsCallable() *

*
UpdateModel

UpdateModel

Update of model metadata. Only fields that currently can be updated are: `filtering_option` and `periodic_tuning_state`. If other values are provided, this API method ignores them.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateModel(UpdateModelRequest request) + *
  • updateModel(UpdateModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateModel(Model model, FieldMask updateMask) + *
  • updateModel(Model model, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateModelCallable() + *
  • updateModelCallable() *

*
TuneModel

TuneModel

Tunes an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • tuneModelAsync(TuneModelRequest request) + *
  • tuneModelAsync(TuneModelRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • tuneModelAsync(ModelName name) - *
  • tuneModelAsync(String name) + *
  • tuneModelAsync(ModelName name) + *

  • tuneModelAsync(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • tuneModelOperationCallable() - *
  • tuneModelCallable() + *
  • tuneModelOperationCallable() + *

  • tuneModelCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceClient.java index 74b1fe2c5047..a7c61e73f9a8 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/PredictionServiceClient.java @@ -59,25 +59,26 @@ * close(). * * + * * * * * + * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
Predict

Predict

Makes a recommendation prediction.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • predict(PredictRequest request) + *
  • predict(PredictRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • predictCallable() + *
  • predictCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceClient.java index 3422108d4075..bb1786d92869 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ProductServiceClient.java @@ -65,141 +65,143 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * - * *
Methods
MethodDescriptionMethod Variants
CreateProduct

CreateProduct

Creates a [Product][google.cloud.retail.v2alpha.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createProduct(CreateProductRequest request) + *
  • createProduct(CreateProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • createProduct(BranchName parent, Product product, String productId) - *
  • createProduct(String parent, Product product, String productId) + *
  • createProduct(BranchName parent, Product product, String productId) + *

  • createProduct(String parent, Product product, String productId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createProductCallable() + *
  • createProductCallable() *

*
GetProduct

GetProduct

Gets a [Product][google.cloud.retail.v2alpha.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getProduct(GetProductRequest request) + *
  • getProduct(GetProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getProduct(ProductName name) - *
  • getProduct(String name) + *
  • getProduct(ProductName name) + *

  • getProduct(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getProductCallable() + *
  • getProductCallable() *

*
ListProducts

ListProducts

Gets a list of [Product][google.cloud.retail.v2alpha.Product]s.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listProducts(ListProductsRequest request) + *
  • listProducts(ListProductsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listProducts(BranchName parent) - *
  • listProducts(String parent) + *
  • listProducts(BranchName parent) + *

  • listProducts(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listProductsPagedCallable() - *
  • listProductsCallable() + *
  • listProductsPagedCallable() + *

  • listProductsCallable() *

*
UpdateProduct

UpdateProduct

Updates a [Product][google.cloud.retail.v2alpha.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateProduct(UpdateProductRequest request) + *
  • updateProduct(UpdateProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateProduct(Product product, FieldMask updateMask) + *
  • updateProduct(Product product, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateProductCallable() + *
  • updateProductCallable() *

*
DeleteProduct

DeleteProduct

Deletes a [Product][google.cloud.retail.v2alpha.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteProduct(DeleteProductRequest request) + *
  • deleteProduct(DeleteProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteProduct(ProductName name) - *
  • deleteProduct(String name) + *
  • deleteProduct(ProductName name) + *

  • deleteProduct(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteProductCallable() + *
  • deleteProductCallable() *

*
PurgeProducts

PurgeProducts

Permanently deletes all selected [Product][google.cloud.retail.v2alpha.Product]s under a branch. *

This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation could take hours to complete. Before the operation completes, some [Product][google.cloud.retail.v2alpha.Product]s may still be returned by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. *

Depending on the number of [Product][google.cloud.retail.v2alpha.Product]s, this operation could take hours to complete. To get a sample of [Product][google.cloud.retail.v2alpha.Product]s that would be deleted, set [PurgeProductsRequest.force][google.cloud.retail.v2alpha.PurgeProductsRequest.force] to false.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • purgeProductsAsync(PurgeProductsRequest request) + *
  • purgeProductsAsync(PurgeProductsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • purgeProductsOperationCallable() - *
  • purgeProductsCallable() + *
  • purgeProductsOperationCallable() + *

  • purgeProductsCallable() *

*
ImportProducts

ImportProducts

Bulk import of multiple [Product][google.cloud.retail.v2alpha.Product]s. *

Request processing may be synchronous. Non-existing items are created. *

Note that it is possible for a subset of the [Product][google.cloud.retail.v2alpha.Product]s to be successfully updated.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • importProductsAsync(ImportProductsRequest request) + *
  • importProductsAsync(ImportProductsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • importProductsOperationCallable() - *
  • importProductsCallable() + *
  • importProductsOperationCallable() + *

  • importProductsCallable() *

*
SetInventory

SetInventory

Updates inventory information for a [Product][google.cloud.retail.v2alpha.Product] while respecting the last update timestamps of each inventory field. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. *

When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] request. @@ -211,21 +213,21 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • setInventoryAsync(SetInventoryRequest request) + *
  • setInventoryAsync(SetInventoryRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • setInventoryAsync(Product inventory, FieldMask setMask) + *
  • setInventoryAsync(Product inventory, FieldMask setMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • setInventoryOperationCallable() - *
  • setInventoryCallable() + *
  • setInventoryOperationCallable() + *

  • setInventoryCallable() *

*
AddFulfillmentPlaces

AddFulfillmentPlaces

It is recommended to use the [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] method instead of [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.AddFulfillmentPlaces]. [ProductService.AddLocalInventories][google.cloud.retail.v2alpha.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. *

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. @@ -234,22 +236,22 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request) + *
  • addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • addFulfillmentPlacesAsync(ProductName product) - *
  • addFulfillmentPlacesAsync(String product) + *
  • addFulfillmentPlacesAsync(ProductName product) + *

  • addFulfillmentPlacesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addFulfillmentPlacesOperationCallable() - *
  • addFulfillmentPlacesCallable() + *
  • addFulfillmentPlacesOperationCallable() + *

  • addFulfillmentPlacesCallable() *

*
RemoveFulfillmentPlaces

RemoveFulfillmentPlaces

It is recommended to use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] method instead of [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2alpha.ProductService.RemoveFulfillmentPlaces]. [ProductService.RemoveLocalInventories][google.cloud.retail.v2alpha.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. *

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2alpha.FulfillmentInfo.place_ids]. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. @@ -258,22 +260,22 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request) + *
  • removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • removeFulfillmentPlacesAsync(ProductName product) - *
  • removeFulfillmentPlacesAsync(String product) + *
  • removeFulfillmentPlacesAsync(ProductName product) + *

  • removeFulfillmentPlacesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeFulfillmentPlacesOperationCallable() - *
  • removeFulfillmentPlacesCallable() + *
  • removeFulfillmentPlacesOperationCallable() + *

  • removeFulfillmentPlacesCallable() *

*
AddLocalInventories

AddLocalInventories

Updates local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places, while respecting the last update timestamps of each inventory field. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2alpha.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. *

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. @@ -282,22 +284,22 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addLocalInventoriesAsync(AddLocalInventoriesRequest request) + *
  • addLocalInventoriesAsync(AddLocalInventoriesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • addLocalInventoriesAsync(ProductName product) - *
  • addLocalInventoriesAsync(String product) + *
  • addLocalInventoriesAsync(ProductName product) + *

  • addLocalInventoriesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addLocalInventoriesOperationCallable() - *
  • addLocalInventoriesCallable() + *
  • addLocalInventoriesOperationCallable() + *

  • addLocalInventoriesCallable() *

*
RemoveLocalInventories

RemoveLocalInventories

Remove local inventory information for a [Product][google.cloud.retail.v2alpha.Product] at a list of places at a removal timestamp. *

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2alpha.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2alpha.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2alpha.ProductService.ListProducts]. *

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2alpha.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2alpha.ProductService.UpdateProduct] has no effect on local inventories. @@ -306,21 +308,20 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeLocalInventoriesAsync(RemoveLocalInventoriesRequest request) + *
  • removeLocalInventoriesAsync(RemoveLocalInventoriesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • removeLocalInventoriesAsync(ProductName product) - *
  • removeLocalInventoriesAsync(String product) + *
  • removeLocalInventoriesAsync(ProductName product) + *

  • removeLocalInventoriesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeLocalInventoriesOperationCallable() - *
  • removeLocalInventoriesCallable() + *
  • removeLocalInventoriesOperationCallable() + *

  • removeLocalInventoriesCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceClient.java index 331c3a7c5fe9..2b4e80bb5b01 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/SearchServiceClient.java @@ -85,27 +85,28 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
Search

Search

Performs a search. *

This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • search(SearchRequest request) + *
  • search(SearchRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • searchPagedCallable() - *
  • searchCallable() + *
  • searchPagedCallable() + *

  • searchCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClient.java index 0b93b3f0dfbd..f8222d433736 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/ServingConfigServiceClient.java @@ -63,147 +63,148 @@ * calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
CreateServingConfig

CreateServingConfig

Creates a ServingConfig. *

A maximum of 100 [ServingConfig][google.cloud.retail.v2alpha.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2alpha.Catalog], otherwise a FAILED_PRECONDITION error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createServingConfig(CreateServingConfigRequest request) + *
  • createServingConfig(CreateServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • createServingConfig(CatalogName parent, ServingConfig servingConfig, String servingConfigId) - *
  • createServingConfig(String parent, ServingConfig servingConfig, String servingConfigId) + *
  • createServingConfig(CatalogName parent, ServingConfig servingConfig, String servingConfigId) + *

  • createServingConfig(String parent, ServingConfig servingConfig, String servingConfigId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createServingConfigCallable() + *
  • createServingConfigCallable() *

*
DeleteServingConfig

DeleteServingConfig

Deletes a ServingConfig. *

Returns a NotFound error if the ServingConfig does not exist.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteServingConfig(DeleteServingConfigRequest request) + *
  • deleteServingConfig(DeleteServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteServingConfig(ServingConfigName name) - *
  • deleteServingConfig(String name) + *
  • deleteServingConfig(ServingConfigName name) + *

  • deleteServingConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteServingConfigCallable() + *
  • deleteServingConfigCallable() *

*
UpdateServingConfig

UpdateServingConfig

Updates a ServingConfig.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateServingConfig(UpdateServingConfigRequest request) + *
  • updateServingConfig(UpdateServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateServingConfig(ServingConfig servingConfig, FieldMask updateMask) + *
  • updateServingConfig(ServingConfig servingConfig, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateServingConfigCallable() + *
  • updateServingConfigCallable() *

*
GetServingConfig

GetServingConfig

Gets a ServingConfig. *

Returns a NotFound error if the ServingConfig does not exist.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getServingConfig(GetServingConfigRequest request) + *
  • getServingConfig(GetServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getServingConfig(ServingConfigName name) - *
  • getServingConfig(String name) + *
  • getServingConfig(ServingConfigName name) + *

  • getServingConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getServingConfigCallable() + *
  • getServingConfigCallable() *

*
ListServingConfigs

ListServingConfigs

Lists all ServingConfigs linked to this catalog.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listServingConfigs(ListServingConfigsRequest request) + *
  • listServingConfigs(ListServingConfigsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listServingConfigs(CatalogName parent) - *
  • listServingConfigs(String parent) + *
  • listServingConfigs(CatalogName parent) + *

  • listServingConfigs(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listServingConfigsPagedCallable() - *
  • listServingConfigsCallable() + *
  • listServingConfigsPagedCallable() + *

  • listServingConfigsCallable() *

*
AddControl

AddControl

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addControl(AddControlRequest request) + *
  • addControl(AddControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • addControl(ServingConfigName servingConfig) - *
  • addControl(String servingConfig) + *
  • addControl(ServingConfigName servingConfig) + *

  • addControl(String servingConfig) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addControlCallable() + *
  • addControlCallable() *

*
RemoveControl

RemoveControl

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeControl(RemoveControlRequest request) + *
  • removeControl(RemoveControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • removeControl(ServingConfigName servingConfig) - *
  • removeControl(String servingConfig) + *
  • removeControl(ServingConfigName servingConfig) + *

  • removeControl(String servingConfig) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeControlCallable() + *
  • removeControlCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceClient.java index 546b5056d59d..5e5bbfc0472d 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/UserEventServiceClient.java @@ -59,86 +59,87 @@ * close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
WriteUserEvent

WriteUserEvent

Writes a single user event.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • writeUserEvent(WriteUserEventRequest request) + *
  • writeUserEvent(WriteUserEventRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • writeUserEventCallable() + *
  • writeUserEventCallable() *

*
CollectUserEvent

CollectUserEvent

Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain. *

This method is used only by the Retail API JavaScript pixel and Google Tag Manager. Users should not call this method directly.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • collectUserEvent(CollectUserEventRequest request) + *
  • collectUserEvent(CollectUserEventRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • collectUserEventCallable() + *
  • collectUserEventCallable() *

*
PurgeUserEvents

PurgeUserEvents

Deletes permanently all user events specified by the filter provided. Depending on the number of events specified by the filter, this operation could take hours or days to complete. To test a filter, use the list command first.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • purgeUserEventsAsync(PurgeUserEventsRequest request) + *
  • purgeUserEventsAsync(PurgeUserEventsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • purgeUserEventsOperationCallable() - *
  • purgeUserEventsCallable() + *
  • purgeUserEventsOperationCallable() + *

  • purgeUserEventsCallable() *

*
ImportUserEvents

ImportUserEvents

Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. *

`Operation.response` is of type `ImportResponse`. Note that it is possible for a subset of the items to be successfully inserted. `Operation.metadata` is of type `ImportMetadata`.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • importUserEventsAsync(ImportUserEventsRequest request) + *
  • importUserEventsAsync(ImportUserEventsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • importUserEventsOperationCallable() - *
  • importUserEventsCallable() + *
  • importUserEventsOperationCallable() + *

  • importUserEventsCallable() *

*
RejoinUserEvents

RejoinUserEvents

Starts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from the catalog when the user event is ingested. These events are stored as unjoined events with limited usage on training and serving. You can use this method to start a join operation on specified events with the latest version of product catalog. You can also use this method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • rejoinUserEventsAsync(RejoinUserEventsRequest request) + *
  • rejoinUserEventsAsync(RejoinUserEventsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • rejoinUserEventsOperationCallable() - *
  • rejoinUserEventsCallable() + *
  • rejoinUserEventsOperationCallable() + *

  • rejoinUserEventsCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/gapic_metadata.json b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/gapic_metadata.json index cd13fcbcb7eb..3c65a87ce132 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/gapic_metadata.json +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/gapic_metadata.json @@ -5,6 +5,18 @@ "protoPackage": "google.cloud.retail.v2alpha", "libraryPackage": "com.google.cloud.retail.v2alpha", "services": { + "AnalyticsService": { + "clients": { + "grpc": { + "libraryClient": "AnalyticsServiceClient", + "rpcs": { + "ExportAnalyticsMetrics": { + "methods": ["exportAnalyticsMetricsAsync", "exportAnalyticsMetricsOperationCallable", "exportAnalyticsMetricsCallable"] + } + } + } + } + }, "CatalogService": { "clients": { "grpc": { diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/package-info.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/package-info.java index e6cc96cd27bc..52af901af334 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/package-info.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/package-info.java @@ -19,6 +19,31 @@ * *

The interfaces provided are listed below, along with usage samples. * + *

======================= AnalyticsServiceClient ======================= + * + *

Service Description: Service for managing & accessing retail search business metric. + * Retail recommendation business metric is currently not available. + * + *

Sample for AnalyticsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) {
+ *   ExportAnalyticsMetricsRequest request =
+ *       ExportAnalyticsMetricsRequest.newBuilder()
+ *           .setCatalog("catalog555704345")
+ *           .setOutputConfig(OutputConfig.newBuilder().build())
+ *           .setFilter("filter-1274492040")
+ *           .build();
+ *   ExportAnalyticsMetricsResponse response =
+ *       analyticsServiceClient.exportAnalyticsMetricsAsync(request).get();
+ * }
+ * }
+ * *

======================= CatalogServiceClient ======================= * *

Service Description: Service for managing catalog configuration. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/AnalyticsServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/AnalyticsServiceStub.java new file mode 100644 index 000000000000..83252d53682b --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/AnalyticsServiceStub.java @@ -0,0 +1,61 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2alpha.ExportMetadata; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the AnalyticsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class AnalyticsServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: exportAnalyticsMetricsOperationCallable()"); + } + + public UnaryCallable exportAnalyticsMetricsCallable() { + throw new UnsupportedOperationException("Not implemented: exportAnalyticsMetricsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/AnalyticsServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/AnalyticsServiceStubSettings.java new file mode 100644 index 000000000000..e1392d85a051 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/AnalyticsServiceStubSettings.java @@ -0,0 +1,412 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2alpha.ExportMetadata; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AnalyticsServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (retail.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of exportAnalyticsMetrics to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsServiceStubSettings.Builder analyticsServiceSettingsBuilder =
+ *     AnalyticsServiceStubSettings.newBuilder();
+ * analyticsServiceSettingsBuilder
+ *     .exportAnalyticsMetricsSettings()
+ *     .setRetrySettings(
+ *         analyticsServiceSettingsBuilder
+ *             .exportAnalyticsMetricsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AnalyticsServiceStubSettings analyticsServiceSettings = analyticsServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AnalyticsServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings + exportAnalyticsMetricsSettings; + private final OperationCallSettings< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings; + + /** Returns the object with the settings used for calls to exportAnalyticsMetrics. */ + public UnaryCallSettings + exportAnalyticsMetricsSettings() { + return exportAnalyticsMetricsSettings; + } + + /** Returns the object with the settings used for calls to exportAnalyticsMetrics. */ + public OperationCallSettings< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings() { + return exportAnalyticsMetricsOperationSettings; + } + + public AnalyticsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAnalyticsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAnalyticsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "retail"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "retail.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "retail.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AnalyticsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AnalyticsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AnalyticsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AnalyticsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + exportAnalyticsMetricsSettings = settingsBuilder.exportAnalyticsMetricsSettings().build(); + exportAnalyticsMetricsOperationSettings = + settingsBuilder.exportAnalyticsMetricsOperationSettings().build(); + } + + /** Builder for AnalyticsServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + exportAnalyticsMetricsSettings; + private final OperationCallSettings.Builder< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + exportAnalyticsMetricsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + exportAnalyticsMetricsOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(exportAnalyticsMetricsSettings); + initDefaults(this); + } + + protected Builder(AnalyticsServiceStubSettings settings) { + super(settings); + + exportAnalyticsMetricsSettings = settings.exportAnalyticsMetricsSettings.toBuilder(); + exportAnalyticsMetricsOperationSettings = + settings.exportAnalyticsMetricsOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(exportAnalyticsMetricsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .exportAnalyticsMetricsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .exportAnalyticsMetricsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + ExportAnalyticsMetricsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ExportMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to exportAnalyticsMetrics. */ + public UnaryCallSettings.Builder + exportAnalyticsMetricsSettings() { + return exportAnalyticsMetricsSettings; + } + + /** Returns the builder for the settings used for calls to exportAnalyticsMetrics. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings() { + return exportAnalyticsMetricsOperationSettings; + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + @Override + public AnalyticsServiceStubSettings build() throws IOException { + return new AnalyticsServiceStubSettings(this); + } + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStubSettings.java index e0dcb22486dd..33551227270d 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CatalogServiceStubSettings.java @@ -280,6 +280,15 @@ public CatalogServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -528,7 +537,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -541,7 +549,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -699,6 +706,15 @@ public UnaryCallSettings.Builder setDefaultBranc return replaceCatalogAttributeSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public CatalogServiceStubSettings build() throws IOException { return new CatalogServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStubSettings.java index 4f96a5a87371..e4a9a47272a4 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/CompletionServiceStubSettings.java @@ -139,6 +139,15 @@ public CompletionServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -320,7 +329,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -333,7 +341,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -415,6 +422,15 @@ public Builder applyToAllUnaryMethods( return importCompletionDataOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public CompletionServiceStubSettings build() throws IOException { return new CompletionServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStubSettings.java index 8f57dcdaec39..60bd456ee0d4 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ControlServiceStubSettings.java @@ -206,6 +206,15 @@ public ControlServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -386,7 +395,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -399,7 +407,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -477,6 +484,15 @@ public UnaryCallSettings.Builder getControlSettings( return listControlsSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ControlServiceStubSettings build() throws IOException { return new ControlServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcAnalyticsServiceCallableFactory.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcAnalyticsServiceCallableFactory.java new file mode 100644 index 000000000000..54feeea1fb71 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcAnalyticsServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the AnalyticsService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAnalyticsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcAnalyticsServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcAnalyticsServiceStub.java new file mode 100644 index 000000000000..af93fc3a5642 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/GrpcAnalyticsServiceStub.java @@ -0,0 +1,188 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2alpha.ExportMetadata; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the AnalyticsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAnalyticsServiceStub extends AnalyticsServiceStub { + private static final MethodDescriptor + exportAnalyticsMetricsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2alpha.AnalyticsService/ExportAnalyticsMetrics") + .setRequestMarshaller( + ProtoUtils.marshaller(ExportAnalyticsMetricsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable + exportAnalyticsMetricsCallable; + private final OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAnalyticsServiceStub create(AnalyticsServiceStubSettings settings) + throws IOException { + return new GrpcAnalyticsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAnalyticsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcAnalyticsServiceStub( + AnalyticsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAnalyticsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAnalyticsServiceStub( + AnalyticsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAnalyticsServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcAnalyticsServiceStub( + AnalyticsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcAnalyticsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcAnalyticsServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcAnalyticsServiceStub( + AnalyticsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + exportAnalyticsMetricsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportAnalyticsMetricsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("catalog", String.valueOf(request.getCatalog())); + return builder.build(); + }) + .build(); + + this.exportAnalyticsMetricsCallable = + callableFactory.createUnaryCallable( + exportAnalyticsMetricsTransportSettings, + settings.exportAnalyticsMetricsSettings(), + clientContext); + this.exportAnalyticsMetricsOperationCallable = + callableFactory.createOperationCallable( + exportAnalyticsMetricsTransportSettings, + settings.exportAnalyticsMetricsOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable exportAnalyticsMetricsCallable() { + return exportAnalyticsMetricsCallable; + } + + @Override + public OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable() { + return exportAnalyticsMetricsOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/HttpJsonAnalyticsServiceCallableFactory.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/HttpJsonAnalyticsServiceCallableFactory.java new file mode 100644 index 000000000000..42f190893331 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/HttpJsonAnalyticsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the AnalyticsService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonAnalyticsServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/HttpJsonAnalyticsServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/HttpJsonAnalyticsServiceStub.java new file mode 100644 index 000000000000..5951730129b4 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/HttpJsonAnalyticsServiceStub.java @@ -0,0 +1,286 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.stub; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2alpha.ExportMetadata; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the AnalyticsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonAnalyticsServiceStub extends AnalyticsServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(ExportMetadata.getDescriptor()) + .add(ExportAnalyticsMetricsResponse.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + exportAnalyticsMetricsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.retail.v2alpha.AnalyticsService/ExportAnalyticsMetrics") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2alpha/{catalog=projects/*/locations/*/catalogs/*}:exportAnalyticsMetrics", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "catalog", request.getCatalog()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearCatalog().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ExportAnalyticsMetricsRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable + exportAnalyticsMetricsCallable; + private final OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAnalyticsServiceStub create(AnalyticsServiceStubSettings settings) + throws IOException { + return new HttpJsonAnalyticsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAnalyticsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAnalyticsServiceStub( + AnalyticsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAnalyticsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAnalyticsServiceStub( + AnalyticsServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAnalyticsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonAnalyticsServiceStub( + AnalyticsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonAnalyticsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAnalyticsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonAnalyticsServiceStub( + AnalyticsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet( + "/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v2alpha/{name=projects/*/locations/*/catalogs/*/branches/*/places/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v2alpha/{name=projects/*/locations/*/catalogs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v2alpha/{name=projects/*/locations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v2alpha/{name=projects/*/operations/*}") + .build()) + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v2alpha/{name=projects/*/locations/*/catalogs/*}/operations") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v2alpha/{name=projects/*/locations/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v2alpha/{name=projects/*}/operations") + .build()) + .build()) + .build()); + + HttpJsonCallSettings + exportAnalyticsMetricsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(exportAnalyticsMetricsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("catalog", String.valueOf(request.getCatalog())); + return builder.build(); + }) + .build(); + + this.exportAnalyticsMetricsCallable = + callableFactory.createUnaryCallable( + exportAnalyticsMetricsTransportSettings, + settings.exportAnalyticsMetricsSettings(), + clientContext); + this.exportAnalyticsMetricsOperationCallable = + callableFactory.createOperationCallable( + exportAnalyticsMetricsTransportSettings, + settings.exportAnalyticsMetricsOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(exportAnalyticsMetricsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable exportAnalyticsMetricsCallable() { + return exportAnalyticsMetricsCallable; + } + + @Override + public OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable() { + return exportAnalyticsMetricsOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/MerchantCenterAccountLinkServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/MerchantCenterAccountLinkServiceStubSettings.java index fae62cfac8d7..a1f02c101995 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/MerchantCenterAccountLinkServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/MerchantCenterAccountLinkServiceStubSettings.java @@ -159,6 +159,15 @@ public MerchantCenterAccountLinkServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -349,7 +358,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -362,7 +370,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -460,6 +467,15 @@ public Builder applyToAllUnaryMethods( return deleteMerchantCenterAccountLinkSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public MerchantCenterAccountLinkServiceStubSettings build() throws IOException { return new MerchantCenterAccountLinkServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ModelServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ModelServiceStubSettings.java index 47ca7b40fbd1..80f309e20558 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ModelServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ModelServiceStubSettings.java @@ -251,6 +251,15 @@ public ModelServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -473,7 +482,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -486,7 +494,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -655,6 +662,15 @@ public UnaryCallSettings.Builder tuneModelSettings( return tuneModelOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ModelServiceStubSettings build() throws IOException { return new ModelServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStubSettings.java index f9daac72fe7a..f7c25c153ac5 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/PredictionServiceStubSettings.java @@ -113,6 +113,15 @@ public PredictionServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -278,7 +287,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -291,7 +299,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -327,6 +334,15 @@ public UnaryCallSettings.Builder predictSetting return predictSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public PredictionServiceStubSettings build() throws IOException { return new PredictionServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStubSettings.java index 990a0579c9fd..c2c0e064a131 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ProductServiceStubSettings.java @@ -355,6 +355,15 @@ public ProductServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -665,7 +674,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -678,7 +686,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -1073,6 +1080,15 @@ public UnaryCallSettings.Builder setInventorySet return removeLocalInventoriesOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ProductServiceStubSettings build() throws IOException { return new ProductServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStubSettings.java index 27cc3f716eb9..b1d60c752ac5 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/SearchServiceStubSettings.java @@ -174,6 +174,15 @@ public SearchServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -340,7 +349,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -353,7 +361,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -390,6 +397,15 @@ public Builder applyToAllUnaryMethods( return searchSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public SearchServiceStubSettings build() throws IOException { return new SearchServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStubSettings.java index 154ca3c54534..46948cab535e 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/ServingConfigServiceStubSettings.java @@ -235,6 +235,15 @@ public ServingConfigServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -433,7 +442,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -446,7 +454,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -548,6 +555,15 @@ public UnaryCallSettings.Builder removeCont return removeControlSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ServingConfigServiceStubSettings build() throws IOException { return new ServingConfigServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStubSettings.java index 1fcccdc9d988..3e5e82a19f57 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2alpha/stub/UserEventServiceStubSettings.java @@ -180,6 +180,15 @@ public UserEventServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -426,7 +435,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -439,7 +447,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -616,6 +623,15 @@ public UnaryCallSettings.Builder purgeUserEve return rejoinUserEventsOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public UserEventServiceStubSettings build() throws IOException { return new UserEventServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceClient.java new file mode 100644 index 000000000000..9c0afa5a2187 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceClient.java @@ -0,0 +1,352 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.stub.AnalyticsServiceStub; +import com.google.cloud.retail.v2beta.stub.AnalyticsServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for managing & accessing retail search business metric. Retail + * recommendation business metric is currently not available. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) {
+ *   ExportAnalyticsMetricsRequest request =
+ *       ExportAnalyticsMetricsRequest.newBuilder()
+ *           .setCatalog("catalog555704345")
+ *           .setOutputConfig(OutputConfig.newBuilder().build())
+ *           .setFilter("filter-1274492040")
+ *           .build();
+ *   ExportAnalyticsMetricsResponse response =
+ *       analyticsServiceClient.exportAnalyticsMetricsAsync(request).get();
+ * }
+ * }
+ * + *

Note: close() needs to be called on the AnalyticsServiceClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

ExportAnalyticsMetrics

Exports analytics metrics. + *

`Operation.response` is of type `ExportAnalyticsMetricsResponse`. `Operation.metadata` is of type `ExportMetadata`.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • exportAnalyticsMetricsAsync(ExportAnalyticsMetricsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • exportAnalyticsMetricsOperationCallable() + *

  • exportAnalyticsMetricsCallable() + *

+ *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of AnalyticsServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsServiceSettings analyticsServiceSettings =
+ *     AnalyticsServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AnalyticsServiceClient analyticsServiceClient =
+ *     AnalyticsServiceClient.create(analyticsServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsServiceSettings analyticsServiceSettings =
+ *     AnalyticsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AnalyticsServiceClient analyticsServiceClient =
+ *     AnalyticsServiceClient.create(analyticsServiceSettings);
+ * }
+ * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsServiceSettings analyticsServiceSettings =
+ *     AnalyticsServiceSettings.newHttpJsonBuilder().build();
+ * AnalyticsServiceClient analyticsServiceClient =
+ *     AnalyticsServiceClient.create(analyticsServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class AnalyticsServiceClient implements BackgroundResource { + private final AnalyticsServiceSettings settings; + private final AnalyticsServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of AnalyticsServiceClient with default settings. */ + public static final AnalyticsServiceClient create() throws IOException { + return create(AnalyticsServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AnalyticsServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final AnalyticsServiceClient create(AnalyticsServiceSettings settings) + throws IOException { + return new AnalyticsServiceClient(settings); + } + + /** + * Constructs an instance of AnalyticsServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(AnalyticsServiceSettings). + */ + public static final AnalyticsServiceClient create(AnalyticsServiceStub stub) { + return new AnalyticsServiceClient(stub); + } + + /** + * Constructs an instance of AnalyticsServiceClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected AnalyticsServiceClient(AnalyticsServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AnalyticsServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected AnalyticsServiceClient(AnalyticsServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final AnalyticsServiceSettings getSettings() { + return settings; + } + + public AnalyticsServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports analytics metrics. + * + *

`Operation.response` is of type `ExportAnalyticsMetricsResponse`. `Operation.metadata` is of + * type `ExportMetadata`. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) {
+   *   ExportAnalyticsMetricsRequest request =
+   *       ExportAnalyticsMetricsRequest.newBuilder()
+   *           .setCatalog("catalog555704345")
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ExportAnalyticsMetricsResponse response =
+   *       analyticsServiceClient.exportAnalyticsMetricsAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + exportAnalyticsMetricsAsync(ExportAnalyticsMetricsRequest request) { + return exportAnalyticsMetricsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports analytics metrics. + * + *

`Operation.response` is of type `ExportAnalyticsMetricsResponse`. `Operation.metadata` is of + * type `ExportMetadata`. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) {
+   *   ExportAnalyticsMetricsRequest request =
+   *       ExportAnalyticsMetricsRequest.newBuilder()
+   *           .setCatalog("catalog555704345")
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   OperationFuture future =
+   *       analyticsServiceClient.exportAnalyticsMetricsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ExportAnalyticsMetricsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable() { + return stub.exportAnalyticsMetricsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports analytics metrics. + * + *

`Operation.response` is of type `ExportAnalyticsMetricsResponse`. `Operation.metadata` is of + * type `ExportMetadata`. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) {
+   *   ExportAnalyticsMetricsRequest request =
+   *       ExportAnalyticsMetricsRequest.newBuilder()
+   *           .setCatalog("catalog555704345")
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       analyticsServiceClient.exportAnalyticsMetricsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + exportAnalyticsMetricsCallable() { + return stub.exportAnalyticsMetricsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceSettings.java new file mode 100644 index 000000000000..82372e04ef81 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceSettings.java @@ -0,0 +1,225 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2beta.stub.AnalyticsServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AnalyticsServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (retail.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of exportAnalyticsMetrics to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsServiceSettings.Builder analyticsServiceSettingsBuilder =
+ *     AnalyticsServiceSettings.newBuilder();
+ * analyticsServiceSettingsBuilder
+ *     .exportAnalyticsMetricsSettings()
+ *     .setRetrySettings(
+ *         analyticsServiceSettingsBuilder
+ *             .exportAnalyticsMetricsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AnalyticsServiceSettings analyticsServiceSettings = analyticsServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AnalyticsServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to exportAnalyticsMetrics. */ + public UnaryCallSettings + exportAnalyticsMetricsSettings() { + return ((AnalyticsServiceStubSettings) getStubSettings()).exportAnalyticsMetricsSettings(); + } + + /** Returns the object with the settings used for calls to exportAnalyticsMetrics. */ + public OperationCallSettings< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings() { + return ((AnalyticsServiceStubSettings) getStubSettings()) + .exportAnalyticsMetricsOperationSettings(); + } + + public static final AnalyticsServiceSettings create(AnalyticsServiceStubSettings stub) + throws IOException { + return new AnalyticsServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AnalyticsServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AnalyticsServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AnalyticsServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AnalyticsServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AnalyticsServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return AnalyticsServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AnalyticsServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AnalyticsServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AnalyticsServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AnalyticsServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AnalyticsServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(AnalyticsServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AnalyticsServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AnalyticsServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(AnalyticsServiceStubSettings.newHttpJsonBuilder()); + } + + public AnalyticsServiceStubSettings.Builder getStubSettingsBuilder() { + return ((AnalyticsServiceStubSettings.Builder) getStubSettings()); + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to exportAnalyticsMetrics. */ + public UnaryCallSettings.Builder + exportAnalyticsMetricsSettings() { + return getStubSettingsBuilder().exportAnalyticsMetricsSettings(); + } + + /** Returns the builder for the settings used for calls to exportAnalyticsMetrics. */ + public OperationCallSettings.Builder< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings() { + return getStubSettingsBuilder().exportAnalyticsMetricsOperationSettings(); + } + + @Override + public AnalyticsServiceSettings build() throws IOException { + return new AnalyticsServiceSettings(this); + } + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceClient.java index 44dd89925320..2d3c5dfa08bd 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceClient.java @@ -59,50 +59,52 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
ListCatalogs

ListCatalogs

Lists all the [Catalog][google.cloud.retail.v2beta.Catalog]s associated with the project.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listCatalogs(ListCatalogsRequest request) + *
  • listCatalogs(ListCatalogsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listCatalogs(LocationName parent) - *
  • listCatalogs(String parent) + *
  • listCatalogs(LocationName parent) + *

  • listCatalogs(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listCatalogsPagedCallable() - *
  • listCatalogsCallable() + *
  • listCatalogsPagedCallable() + *

  • listCatalogsCallable() *

*
UpdateCatalog

UpdateCatalog

Updates the [Catalog][google.cloud.retail.v2beta.Catalog]s.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateCatalog(UpdateCatalogRequest request) + *
  • updateCatalog(UpdateCatalogRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateCatalog(Catalog catalog, FieldMask updateMask) + *
  • updateCatalog(Catalog catalog, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateCatalogCallable() + *
  • updateCatalogCallable() *

*
SetDefaultBranch

SetDefaultBranch

Set a specified branch id as default branch. API methods such as [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct], [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts] will treat requests using "default_branch" to the actual branch id set as default. *

For example, if `projects/*/locations/*/catalogs/*/branches/1` is set as default, setting [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/default_branch` is equivalent to setting [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to `projects/*/locations/*/catalogs/*/branches/1`. *

Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using `projects/*/locations/*/catalogs/*/branches/default_branch` as [SearchRequest.branch][google.cloud.retail.v2beta.SearchRequest.branch] to route the traffic to this staging branch. @@ -116,173 +118,172 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • setDefaultBranch(SetDefaultBranchRequest request) + *
  • setDefaultBranch(SetDefaultBranchRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • setDefaultBranch(CatalogName catalog) - *
  • setDefaultBranch(String catalog) + *
  • setDefaultBranch(CatalogName catalog) + *

  • setDefaultBranch(String catalog) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • setDefaultBranchCallable() + *
  • setDefaultBranchCallable() *

*
GetDefaultBranch

GetDefaultBranch

Get which branch is currently default branch set by [CatalogService.SetDefaultBranch][google.cloud.retail.v2beta.CatalogService.SetDefaultBranch] method under a specified parent catalog.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getDefaultBranch(GetDefaultBranchRequest request) + *
  • getDefaultBranch(GetDefaultBranchRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getDefaultBranch(CatalogName catalog) - *
  • getDefaultBranch(String catalog) + *
  • getDefaultBranch(CatalogName catalog) + *

  • getDefaultBranch(String catalog) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getDefaultBranchCallable() + *
  • getDefaultBranchCallable() *

*
GetCompletionConfig

GetCompletionConfig

Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getCompletionConfig(GetCompletionConfigRequest request) + *
  • getCompletionConfig(GetCompletionConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getCompletionConfig(CompletionConfigName name) - *
  • getCompletionConfig(String name) + *
  • getCompletionConfig(CompletionConfigName name) + *

  • getCompletionConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getCompletionConfigCallable() + *
  • getCompletionConfigCallable() *

*
UpdateCompletionConfig

UpdateCompletionConfig

Updates the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateCompletionConfig(UpdateCompletionConfigRequest request) + *
  • updateCompletionConfig(UpdateCompletionConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateCompletionConfig(CompletionConfig completionConfig, FieldMask updateMask) + *
  • updateCompletionConfig(CompletionConfig completionConfig, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateCompletionConfigCallable() + *
  • updateCompletionConfigCallable() *

*
GetAttributesConfig

GetAttributesConfig

Gets an [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getAttributesConfig(GetAttributesConfigRequest request) + *
  • getAttributesConfig(GetAttributesConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getAttributesConfig(AttributesConfigName name) - *
  • getAttributesConfig(String name) + *
  • getAttributesConfig(AttributesConfigName name) + *

  • getAttributesConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getAttributesConfigCallable() + *
  • getAttributesConfigCallable() *

*
UpdateAttributesConfig

UpdateAttributesConfig

Updates the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. *

The catalog attributes in the request will be updated in the catalog, or inserted if they do not exist. Existing catalog attributes not included in the request will remain unchanged. Attributes that are assigned to products, but do not exist at the catalog level, are always included in the response. The product attribute is assigned default values for missing catalog attribute fields, e.g., searchable and dynamic facetable options.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateAttributesConfig(UpdateAttributesConfigRequest request) + *
  • updateAttributesConfig(UpdateAttributesConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateAttributesConfig(AttributesConfig attributesConfig, FieldMask updateMask) + *
  • updateAttributesConfig(AttributesConfig attributesConfig, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateAttributesConfigCallable() + *
  • updateAttributesConfigCallable() *

*
AddCatalogAttribute

AddCatalogAttribute

Adds the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. *

If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add already exists, an ALREADY_EXISTS error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addCatalogAttribute(AddCatalogAttributeRequest request) + *
  • addCatalogAttribute(AddCatalogAttributeRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addCatalogAttributeCallable() + *
  • addCatalogAttributeCallable() *

*
RemoveCatalogAttribute

RemoveCatalogAttribute

Removes the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] from the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. *

If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeCatalogAttribute(RemoveCatalogAttributeRequest request) + *
  • removeCatalogAttribute(RemoveCatalogAttributeRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeCatalogAttributeCallable() + *
  • removeCatalogAttributeCallable() *

*
BatchRemoveCatalogAttributes

BatchRemoveCatalogAttributes

Removes all specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s from the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • batchRemoveCatalogAttributes(BatchRemoveCatalogAttributesRequest request) + *
  • batchRemoveCatalogAttributes(BatchRemoveCatalogAttributesRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • batchRemoveCatalogAttributesCallable() + *
  • batchRemoveCatalogAttributesCallable() *

*
ReplaceCatalogAttribute

ReplaceCatalogAttribute

Replaces the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating the catalog attribute with the same [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key]. *

If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to replace does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • replaceCatalogAttribute(ReplaceCatalogAttributeRequest request) + *
  • replaceCatalogAttribute(ReplaceCatalogAttributeRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • replaceCatalogAttributeCallable() + *
  • replaceCatalogAttributeCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceClient.java index b77920ee026d..d0740287bdd7 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceClient.java @@ -66,27 +66,29 @@ * close(). * * + * * * * * + * * - * + * * * * * - * + * * * - * *
Methods
MethodDescriptionMethod Variants
CompleteQuery

CompleteQuery

Completes the specified prefix with keyword suggestions. *

This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • completeQuery(CompleteQueryRequest request) + *
  • completeQuery(CompleteQueryRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • completeQueryCallable() + *
  • completeQueryCallable() *

*
ImportCompletionData

ImportCompletionData

Bulk import of processed completion dataset. *

Request processing is asynchronous. Partial updating is not supported. *

The operation is successfully finished only after the imported suggestions are indexed successfully and ready for serving. The process takes hours. @@ -94,16 +96,15 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • importCompletionDataAsync(ImportCompletionDataRequest request) + *
  • importCompletionDataAsync(ImportCompletionDataRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • importCompletionDataOperationCallable() - *
  • importCompletionDataCallable() + *
  • importCompletionDataOperationCallable() + *

  • importCompletionDataCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceClient.java index fd3efcd53780..9a4478ffb17e 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ControlServiceClient.java @@ -60,109 +60,110 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
CreateControl

CreateControl

Creates a Control. *

If the [Control][google.cloud.retail.v2beta.Control] to create already exists, an ALREADY_EXISTS error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createControl(CreateControlRequest request) + *
  • createControl(CreateControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • createControl(CatalogName parent, Control control, String controlId) - *
  • createControl(String parent, Control control, String controlId) + *
  • createControl(CatalogName parent, Control control, String controlId) + *

  • createControl(String parent, Control control, String controlId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createControlCallable() + *
  • createControlCallable() *

*
DeleteControl

DeleteControl

Deletes a Control. *

If the [Control][google.cloud.retail.v2beta.Control] to delete does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteControl(DeleteControlRequest request) + *
  • deleteControl(DeleteControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteControl(ControlName name) - *
  • deleteControl(String name) + *
  • deleteControl(ControlName name) + *

  • deleteControl(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteControlCallable() + *
  • deleteControlCallable() *

*
UpdateControl

UpdateControl

Updates a Control. *

[Control][google.cloud.retail.v2beta.Control] cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the [Control][google.cloud.retail.v2beta.Control] to update does not exist, a NOT_FOUND error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateControl(UpdateControlRequest request) + *
  • updateControl(UpdateControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateControl(Control control, FieldMask updateMask) + *
  • updateControl(Control control, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateControlCallable() + *
  • updateControlCallable() *

*
GetControl

GetControl

Gets a Control.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getControl(GetControlRequest request) + *
  • getControl(GetControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getControl(ControlName name) - *
  • getControl(String name) + *
  • getControl(ControlName name) + *

  • getControl(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getControlCallable() + *
  • getControlCallable() *

*
ListControls

ListControls

Lists all Controls by their parent [Catalog][google.cloud.retail.v2beta.Catalog].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listControls(ListControlsRequest request) + *
  • listControls(ListControlsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listControls(CatalogName parent) - *
  • listControls(String parent) + *
  • listControls(CatalogName parent) + *

  • listControls(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listControlsPagedCallable() - *
  • listControlsCallable() + *
  • listControlsPagedCallable() + *

  • listControlsCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ModelServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ModelServiceClient.java index dee52f518821..bdd3f4c7b6e8 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ModelServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ModelServiceClient.java @@ -74,164 +74,165 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
CreateModel

CreateModel

Creates a new model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createModelAsync(CreateModelRequest request) + *
  • createModelAsync(CreateModelRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • createModelAsync(CatalogName parent, Model model) - *
  • createModelAsync(String parent, Model model) + *
  • createModelAsync(CatalogName parent, Model model) + *

  • createModelAsync(String parent, Model model) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createModelOperationCallable() - *
  • createModelCallable() + *
  • createModelOperationCallable() + *

  • createModelCallable() *

*
GetModel

GetModel

Gets a model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getModel(GetModelRequest request) + *
  • getModel(GetModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getModel(ModelName name) - *
  • getModel(String name) + *
  • getModel(ModelName name) + *

  • getModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getModelCallable() + *
  • getModelCallable() *

*
PauseModel

PauseModel

Pauses the training of an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • pauseModel(PauseModelRequest request) + *
  • pauseModel(PauseModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • pauseModel(ModelName name) - *
  • pauseModel(String name) + *
  • pauseModel(ModelName name) + *

  • pauseModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • pauseModelCallable() + *
  • pauseModelCallable() *

*
ResumeModel

ResumeModel

Resumes the training of an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • resumeModel(ResumeModelRequest request) + *
  • resumeModel(ResumeModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • resumeModel(String name) + *
  • resumeModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • resumeModelCallable() + *
  • resumeModelCallable() *

*
DeleteModel

DeleteModel

Deletes an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteModel(DeleteModelRequest request) + *
  • deleteModel(DeleteModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteModel(ModelName name) - *
  • deleteModel(String name) + *
  • deleteModel(ModelName name) + *

  • deleteModel(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteModelCallable() + *
  • deleteModelCallable() *

*
ListModels

ListModels

Lists all the models linked to this event store.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listModels(ListModelsRequest request) + *
  • listModels(ListModelsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listModels(CatalogName parent) - *
  • listModels(String parent) + *
  • listModels(CatalogName parent) + *

  • listModels(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listModelsPagedCallable() - *
  • listModelsCallable() + *
  • listModelsPagedCallable() + *

  • listModelsCallable() *

*
UpdateModel

UpdateModel

Update of model metadata. Only fields that currently can be updated are: `filtering_option` and `periodic_tuning_state`. If other values are provided, this API method ignores them.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateModel(UpdateModelRequest request) + *
  • updateModel(UpdateModelRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateModel(Model model, FieldMask updateMask) + *
  • updateModel(Model model, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateModelCallable() + *
  • updateModelCallable() *

*
TuneModel

TuneModel

Tunes an existing model.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • tuneModelAsync(TuneModelRequest request) + *
  • tuneModelAsync(TuneModelRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • tuneModelAsync(ModelName name) - *
  • tuneModelAsync(String name) + *
  • tuneModelAsync(ModelName name) + *

  • tuneModelAsync(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • tuneModelOperationCallable() - *
  • tuneModelCallable() + *
  • tuneModelOperationCallable() + *

  • tuneModelCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceClient.java index ec4df7c0f849..2fa28af001d7 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceClient.java @@ -59,25 +59,26 @@ * close(). * * + * * * * * + * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
Predict

Predict

Makes a recommendation prediction.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • predict(PredictRequest request) + *
  • predict(PredictRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • predictCallable() + *
  • predictCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceClient.java index af23a470f57b..3d5e156dda1b 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ProductServiceClient.java @@ -65,124 +65,126 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * * - * + * * * - * *
Methods
MethodDescriptionMethod Variants
CreateProduct

CreateProduct

Creates a [Product][google.cloud.retail.v2beta.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createProduct(CreateProductRequest request) + *
  • createProduct(CreateProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • createProduct(BranchName parent, Product product, String productId) - *
  • createProduct(String parent, Product product, String productId) + *
  • createProduct(BranchName parent, Product product, String productId) + *

  • createProduct(String parent, Product product, String productId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createProductCallable() + *
  • createProductCallable() *

*
GetProduct

GetProduct

Gets a [Product][google.cloud.retail.v2beta.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getProduct(GetProductRequest request) + *
  • getProduct(GetProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getProduct(ProductName name) - *
  • getProduct(String name) + *
  • getProduct(ProductName name) + *

  • getProduct(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getProductCallable() + *
  • getProductCallable() *

*
ListProducts

ListProducts

Gets a list of [Product][google.cloud.retail.v2beta.Product]s.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listProducts(ListProductsRequest request) + *
  • listProducts(ListProductsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listProducts(BranchName parent) - *
  • listProducts(String parent) + *
  • listProducts(BranchName parent) + *

  • listProducts(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listProductsPagedCallable() - *
  • listProductsCallable() + *
  • listProductsPagedCallable() + *

  • listProductsCallable() *

*
UpdateProduct

UpdateProduct

Updates a [Product][google.cloud.retail.v2beta.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateProduct(UpdateProductRequest request) + *
  • updateProduct(UpdateProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateProduct(Product product, FieldMask updateMask) + *
  • updateProduct(Product product, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateProductCallable() + *
  • updateProductCallable() *

*
DeleteProduct

DeleteProduct

Deletes a [Product][google.cloud.retail.v2beta.Product].

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteProduct(DeleteProductRequest request) + *
  • deleteProduct(DeleteProductRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteProduct(ProductName name) - *
  • deleteProduct(String name) + *
  • deleteProduct(ProductName name) + *

  • deleteProduct(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteProductCallable() + *
  • deleteProductCallable() *

*
ImportProducts

ImportProducts

Bulk import of multiple [Product][google.cloud.retail.v2beta.Product]s. *

Request processing may be synchronous. Non-existing items are created. *

Note that it is possible for a subset of the [Product][google.cloud.retail.v2beta.Product]s to be successfully updated.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • importProductsAsync(ImportProductsRequest request) + *
  • importProductsAsync(ImportProductsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • importProductsOperationCallable() - *
  • importProductsCallable() + *
  • importProductsOperationCallable() + *

  • importProductsCallable() *

*
SetInventory

SetInventory

Updates inventory information for a [Product][google.cloud.retail.v2beta.Product] while respecting the last update timestamps of each inventory field. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2beta.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. *

When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct], the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the [ProductService.CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] request. @@ -194,21 +196,21 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • setInventoryAsync(SetInventoryRequest request) + *
  • setInventoryAsync(SetInventoryRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • setInventoryAsync(Product inventory, FieldMask setMask) + *
  • setInventoryAsync(Product inventory, FieldMask setMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • setInventoryOperationCallable() - *
  • setInventoryCallable() + *
  • setInventoryOperationCallable() + *

  • setInventoryCallable() *

*
AddFulfillmentPlaces

AddFulfillmentPlaces

It is recommended to use the [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories] method instead of [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces]. [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. *

Incrementally adds place IDs to [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the [Product][google.cloud.retail.v2beta.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. @@ -217,22 +219,22 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request) + *
  • addFulfillmentPlacesAsync(AddFulfillmentPlacesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • addFulfillmentPlacesAsync(ProductName product) - *
  • addFulfillmentPlacesAsync(String product) + *
  • addFulfillmentPlacesAsync(ProductName product) + *

  • addFulfillmentPlacesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addFulfillmentPlacesOperationCallable() - *
  • addFulfillmentPlacesCallable() + *
  • addFulfillmentPlacesOperationCallable() + *

  • addFulfillmentPlacesCallable() *

*
RemoveFulfillmentPlaces

RemoveFulfillmentPlaces

It is recommended to use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories] method instead of [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories] achieves the same results but provides more fine-grained control over ingesting local inventory data. *

Incrementally removes place IDs from a [Product.fulfillment_info.place_ids][google.cloud.retail.v2beta.FulfillmentInfo.place_ids]. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.Product] to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the [Product][google.cloud.retail.v2beta.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. @@ -241,22 +243,22 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request) + *
  • removeFulfillmentPlacesAsync(RemoveFulfillmentPlacesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • removeFulfillmentPlacesAsync(ProductName product) - *
  • removeFulfillmentPlacesAsync(String product) + *
  • removeFulfillmentPlacesAsync(ProductName product) + *

  • removeFulfillmentPlacesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeFulfillmentPlacesOperationCallable() - *
  • removeFulfillmentPlacesCallable() + *
  • removeFulfillmentPlacesOperationCallable() + *

  • removeFulfillmentPlacesCallable() *

*
AddLocalInventories

AddLocalInventories

Updates local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a list of places, while respecting the last update timestamps of each inventory field. *

This process is asynchronous and does not require the [Product][google.cloud.retail.v2beta.Product] to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the [Product][google.cloud.retail.v2beta.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. *

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no effect on local inventories. @@ -265,22 +267,22 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addLocalInventoriesAsync(AddLocalInventoriesRequest request) + *
  • addLocalInventoriesAsync(AddLocalInventoriesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • addLocalInventoriesAsync(ProductName product) - *
  • addLocalInventoriesAsync(String product) + *
  • addLocalInventoriesAsync(ProductName product) + *

  • addLocalInventoriesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addLocalInventoriesOperationCallable() - *
  • addLocalInventoriesCallable() + *
  • addLocalInventoriesOperationCallable() + *

  • addLocalInventoriesCallable() *

*
RemoveLocalInventories

RemoveLocalInventories

Remove local inventory information for a [Product][google.cloud.retail.v2beta.Product] at a list of places at a removal timestamp. *

This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the [Product][google.cloud.retail.v2beta.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. *

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no effect on local inventories. @@ -289,21 +291,20 @@ *

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeLocalInventoriesAsync(RemoveLocalInventoriesRequest request) + *
  • removeLocalInventoriesAsync(RemoveLocalInventoriesRequest request) *

*

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

*
    - *
  • removeLocalInventoriesAsync(ProductName product) - *
  • removeLocalInventoriesAsync(String product) + *
  • removeLocalInventoriesAsync(ProductName product) + *

  • removeLocalInventoriesAsync(String product) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeLocalInventoriesOperationCallable() - *
  • removeLocalInventoriesCallable() + *
  • removeLocalInventoriesOperationCallable() + *

  • removeLocalInventoriesCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceClient.java index 116a0df1a7e6..6a2cff5be2d8 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/SearchServiceClient.java @@ -85,27 +85,28 @@ * as threads. In the example above, try-with-resources is used, which automatically calls close(). * * + * * * * * + * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
Search

Search

Performs a search. *

This feature is only available for users who have Retail Search enabled. Enable Retail Search on Cloud Console before using this feature.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • search(SearchRequest request) + *
  • search(SearchRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • searchPagedCallable() - *
  • searchCallable() + *
  • searchPagedCallable() + *

  • searchCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceClient.java index 9b787ed9009b..e5ea2f0051af 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ServingConfigServiceClient.java @@ -63,147 +63,148 @@ * calls close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
CreateServingConfig

CreateServingConfig

Creates a ServingConfig. *

A maximum of 100 [ServingConfig][google.cloud.retail.v2beta.ServingConfig]s are allowed in a [Catalog][google.cloud.retail.v2beta.Catalog], otherwise a FAILED_PRECONDITION error is returned.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • createServingConfig(CreateServingConfigRequest request) + *
  • createServingConfig(CreateServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • createServingConfig(CatalogName parent, ServingConfig servingConfig, String servingConfigId) - *
  • createServingConfig(String parent, ServingConfig servingConfig, String servingConfigId) + *
  • createServingConfig(CatalogName parent, ServingConfig servingConfig, String servingConfigId) + *

  • createServingConfig(String parent, ServingConfig servingConfig, String servingConfigId) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • createServingConfigCallable() + *
  • createServingConfigCallable() *

*
DeleteServingConfig

DeleteServingConfig

Deletes a ServingConfig. *

Returns a NotFound error if the ServingConfig does not exist.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • deleteServingConfig(DeleteServingConfigRequest request) + *
  • deleteServingConfig(DeleteServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • deleteServingConfig(ServingConfigName name) - *
  • deleteServingConfig(String name) + *
  • deleteServingConfig(ServingConfigName name) + *

  • deleteServingConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • deleteServingConfigCallable() + *
  • deleteServingConfigCallable() *

*
UpdateServingConfig

UpdateServingConfig

Updates a ServingConfig.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • updateServingConfig(UpdateServingConfigRequest request) + *
  • updateServingConfig(UpdateServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • updateServingConfig(ServingConfig servingConfig, FieldMask updateMask) + *
  • updateServingConfig(ServingConfig servingConfig, FieldMask updateMask) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • updateServingConfigCallable() + *
  • updateServingConfigCallable() *

*
GetServingConfig

GetServingConfig

Gets a ServingConfig. *

Returns a NotFound error if the ServingConfig does not exist.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • getServingConfig(GetServingConfigRequest request) + *
  • getServingConfig(GetServingConfigRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • getServingConfig(ServingConfigName name) - *
  • getServingConfig(String name) + *
  • getServingConfig(ServingConfigName name) + *

  • getServingConfig(String name) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • getServingConfigCallable() + *
  • getServingConfigCallable() *

*
ListServingConfigs

ListServingConfigs

Lists all ServingConfigs linked to this catalog.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • listServingConfigs(ListServingConfigsRequest request) + *
  • listServingConfigs(ListServingConfigsRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • listServingConfigs(CatalogName parent) - *
  • listServingConfigs(String parent) + *
  • listServingConfigs(CatalogName parent) + *

  • listServingConfigs(String parent) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • listServingConfigsPagedCallable() - *
  • listServingConfigsCallable() + *
  • listServingConfigsPagedCallable() + *

  • listServingConfigsCallable() *

*
AddControl

AddControl

Enables a Control on the specified ServingConfig. The control is added in the last position of the list of controls it belongs to (e.g. if it's a facet spec control it will be applied in the last position of servingConfig.facetSpecIds) Returns a ALREADY_EXISTS error if the control has already been applied. Returns a FAILED_PRECONDITION error if the addition could exceed maximum number of control allowed for that type of control.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • addControl(AddControlRequest request) + *
  • addControl(AddControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • addControl(ServingConfigName servingConfig) - *
  • addControl(String servingConfig) + *
  • addControl(ServingConfigName servingConfig) + *

  • addControl(String servingConfig) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • addControlCallable() + *
  • addControlCallable() *

*
RemoveControl

RemoveControl

Disables a Control on the specified ServingConfig. The control is removed from the ServingConfig. Returns a NOT_FOUND error if the Control is not enabled for the ServingConfig.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • removeControl(RemoveControlRequest request) + *
  • removeControl(RemoveControlRequest request) *

*

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

*
    - *
  • removeControl(ServingConfigName servingConfig) - *
  • removeControl(String servingConfig) + *
  • removeControl(ServingConfigName servingConfig) + *

  • removeControl(String servingConfig) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • removeControlCallable() + *
  • removeControlCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceClient.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceClient.java index b0a53d6d5e43..5e5be1e629b2 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceClient.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceClient.java @@ -59,86 +59,87 @@ * close(). * * + * * * * * + * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * * - * + * * * * - * *
Methods
MethodDescriptionMethod Variants
WriteUserEvent

WriteUserEvent

Writes a single user event.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • writeUserEvent(WriteUserEventRequest request) + *
  • writeUserEvent(WriteUserEventRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • writeUserEventCallable() + *
  • writeUserEventCallable() *

*
CollectUserEvent

CollectUserEvent

Writes a single user event from the browser. This uses a GET request to due to browser restriction of POST-ing to a 3rd party domain. *

This method is used only by the Retail API JavaScript pixel and Google Tag Manager. Users should not call this method directly.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • collectUserEvent(CollectUserEventRequest request) + *
  • collectUserEvent(CollectUserEventRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • collectUserEventCallable() + *
  • collectUserEventCallable() *

*
PurgeUserEvents

PurgeUserEvents

Deletes permanently all user events specified by the filter provided. Depending on the number of events specified by the filter, this operation could take hours or days to complete. To test a filter, use the list command first.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • purgeUserEventsAsync(PurgeUserEventsRequest request) + *
  • purgeUserEventsAsync(PurgeUserEventsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • purgeUserEventsOperationCallable() - *
  • purgeUserEventsCallable() + *
  • purgeUserEventsOperationCallable() + *

  • purgeUserEventsCallable() *

*
ImportUserEvents

ImportUserEvents

Bulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. *

`Operation.response` is of type `ImportResponse`. Note that it is possible for a subset of the items to be successfully inserted. `Operation.metadata` is of type `ImportMetadata`.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • importUserEventsAsync(ImportUserEventsRequest request) + *
  • importUserEventsAsync(ImportUserEventsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • importUserEventsOperationCallable() - *
  • importUserEventsCallable() + *
  • importUserEventsOperationCallable() + *

  • importUserEventsCallable() *

*
RejoinUserEvents

RejoinUserEvents

Starts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from the catalog when the user event is ingested. These events are stored as unjoined events with limited usage on training and serving. You can use this method to start a join operation on specified events with the latest version of product catalog. You can also use this method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.

*

Request object method variants only take one parameter, a request object, which must be constructed before the call.

*
    - *
  • rejoinUserEventsAsync(RejoinUserEventsRequest request) + *
  • rejoinUserEventsAsync(RejoinUserEventsRequest request) *

*

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

*
    - *
  • rejoinUserEventsOperationCallable() - *
  • rejoinUserEventsCallable() + *
  • rejoinUserEventsOperationCallable() + *

  • rejoinUserEventsCallable() *

*
* *

See the individual methods for example code. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/gapic_metadata.json b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/gapic_metadata.json index 9fc728a5a567..d16e2d0a9153 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/gapic_metadata.json +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/gapic_metadata.json @@ -5,6 +5,18 @@ "protoPackage": "google.cloud.retail.v2beta", "libraryPackage": "com.google.cloud.retail.v2beta", "services": { + "AnalyticsService": { + "clients": { + "grpc": { + "libraryClient": "AnalyticsServiceClient", + "rpcs": { + "ExportAnalyticsMetrics": { + "methods": ["exportAnalyticsMetricsAsync", "exportAnalyticsMetricsOperationCallable", "exportAnalyticsMetricsCallable"] + } + } + } + } + }, "CatalogService": { "clients": { "grpc": { diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/package-info.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/package-info.java index 46c7b68d5157..260ec0b5916d 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/package-info.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/package-info.java @@ -19,6 +19,31 @@ * *

The interfaces provided are listed below, along with usage samples. * + *

======================= AnalyticsServiceClient ======================= + * + *

Service Description: Service for managing & accessing retail search business metric. + * Retail recommendation business metric is currently not available. + * + *

Sample for AnalyticsServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) {
+ *   ExportAnalyticsMetricsRequest request =
+ *       ExportAnalyticsMetricsRequest.newBuilder()
+ *           .setCatalog("catalog555704345")
+ *           .setOutputConfig(OutputConfig.newBuilder().build())
+ *           .setFilter("filter-1274492040")
+ *           .build();
+ *   ExportAnalyticsMetricsResponse response =
+ *       analyticsServiceClient.exportAnalyticsMetricsAsync(request).get();
+ * }
+ * }
+ * *

======================= CatalogServiceClient ======================= * *

Service Description: Service for managing catalog configuration. diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/AnalyticsServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/AnalyticsServiceStub.java new file mode 100644 index 000000000000..d977b0970425 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/AnalyticsServiceStub.java @@ -0,0 +1,61 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2beta.ExportMetadata; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the AnalyticsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class AnalyticsServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: exportAnalyticsMetricsOperationCallable()"); + } + + public UnaryCallable exportAnalyticsMetricsCallable() { + throw new UnsupportedOperationException("Not implemented: exportAnalyticsMetricsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/AnalyticsServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/AnalyticsServiceStubSettings.java new file mode 100644 index 000000000000..6da4065b842e --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/AnalyticsServiceStubSettings.java @@ -0,0 +1,412 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2beta.ExportMetadata; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link AnalyticsServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (retail.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of exportAnalyticsMetrics to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AnalyticsServiceStubSettings.Builder analyticsServiceSettingsBuilder =
+ *     AnalyticsServiceStubSettings.newBuilder();
+ * analyticsServiceSettingsBuilder
+ *     .exportAnalyticsMetricsSettings()
+ *     .setRetrySettings(
+ *         analyticsServiceSettingsBuilder
+ *             .exportAnalyticsMetricsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AnalyticsServiceStubSettings analyticsServiceSettings = analyticsServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AnalyticsServiceStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings + exportAnalyticsMetricsSettings; + private final OperationCallSettings< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings; + + /** Returns the object with the settings used for calls to exportAnalyticsMetrics. */ + public UnaryCallSettings + exportAnalyticsMetricsSettings() { + return exportAnalyticsMetricsSettings; + } + + /** Returns the object with the settings used for calls to exportAnalyticsMetrics. */ + public OperationCallSettings< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings() { + return exportAnalyticsMetricsOperationSettings; + } + + public AnalyticsServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAnalyticsServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonAnalyticsServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "retail"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "retail.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "retail.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AnalyticsServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AnalyticsServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AnalyticsServiceStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected AnalyticsServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + exportAnalyticsMetricsSettings = settingsBuilder.exportAnalyticsMetricsSettings().build(); + exportAnalyticsMetricsOperationSettings = + settingsBuilder.exportAnalyticsMetricsOperationSettings().build(); + } + + /** Builder for AnalyticsServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder + exportAnalyticsMetricsSettings; + private final OperationCallSettings.Builder< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_2_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + exportAnalyticsMetricsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + exportAnalyticsMetricsOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(exportAnalyticsMetricsSettings); + initDefaults(this); + } + + protected Builder(AnalyticsServiceStubSettings settings) { + super(settings); + + exportAnalyticsMetricsSettings = settings.exportAnalyticsMetricsSettings.toBuilder(); + exportAnalyticsMetricsOperationSettings = + settings.exportAnalyticsMetricsOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(exportAnalyticsMetricsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .exportAnalyticsMetricsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + + builder + .exportAnalyticsMetricsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + ExportAnalyticsMetricsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ExportMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to exportAnalyticsMetrics. */ + public UnaryCallSettings.Builder + exportAnalyticsMetricsSettings() { + return exportAnalyticsMetricsSettings; + } + + /** Returns the builder for the settings used for calls to exportAnalyticsMetrics. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationSettings() { + return exportAnalyticsMetricsOperationSettings; + } + + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + + @Override + public AnalyticsServiceStubSettings build() throws IOException { + return new AnalyticsServiceStubSettings(this); + } + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStubSettings.java index 8f6facef4a8e..b8b4d227e48f 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStubSettings.java @@ -280,6 +280,15 @@ public CatalogServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -528,7 +537,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -541,7 +549,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -699,6 +706,15 @@ public UnaryCallSettings.Builder setDefaultBranc return replaceCatalogAttributeSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public CatalogServiceStubSettings build() throws IOException { return new CatalogServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStubSettings.java index 74a9220d8018..2ab05b778d03 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CompletionServiceStubSettings.java @@ -139,6 +139,15 @@ public CompletionServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -320,7 +329,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -333,7 +341,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -415,6 +422,15 @@ public Builder applyToAllUnaryMethods( return importCompletionDataOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public CompletionServiceStubSettings build() throws IOException { return new CompletionServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStubSettings.java index 6b938d3ff583..a10ed5e79b47 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ControlServiceStubSettings.java @@ -206,6 +206,15 @@ public ControlServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -386,7 +395,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -399,7 +407,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -477,6 +484,15 @@ public UnaryCallSettings.Builder getControlSettings( return listControlsSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ControlServiceStubSettings build() throws IOException { return new ControlServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcAnalyticsServiceCallableFactory.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcAnalyticsServiceCallableFactory.java new file mode 100644 index 000000000000..1d7d9df5d9fc --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcAnalyticsServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the AnalyticsService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAnalyticsServiceCallableFactory implements GrpcStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcAnalyticsServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcAnalyticsServiceStub.java new file mode 100644 index 000000000000..da67cc155ef2 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcAnalyticsServiceStub.java @@ -0,0 +1,188 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2beta.ExportMetadata; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the AnalyticsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAnalyticsServiceStub extends AnalyticsServiceStub { + private static final MethodDescriptor + exportAnalyticsMetricsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2beta.AnalyticsService/ExportAnalyticsMetrics") + .setRequestMarshaller( + ProtoUtils.marshaller(ExportAnalyticsMetricsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable + exportAnalyticsMetricsCallable; + private final OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAnalyticsServiceStub create(AnalyticsServiceStubSettings settings) + throws IOException { + return new GrpcAnalyticsServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAnalyticsServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcAnalyticsServiceStub( + AnalyticsServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAnalyticsServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAnalyticsServiceStub( + AnalyticsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAnalyticsServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcAnalyticsServiceStub( + AnalyticsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcAnalyticsServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcAnalyticsServiceStub, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcAnalyticsServiceStub( + AnalyticsServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings + exportAnalyticsMetricsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportAnalyticsMetricsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("catalog", String.valueOf(request.getCatalog())); + return builder.build(); + }) + .build(); + + this.exportAnalyticsMetricsCallable = + callableFactory.createUnaryCallable( + exportAnalyticsMetricsTransportSettings, + settings.exportAnalyticsMetricsSettings(), + clientContext); + this.exportAnalyticsMetricsOperationCallable = + callableFactory.createOperationCallable( + exportAnalyticsMetricsTransportSettings, + settings.exportAnalyticsMetricsOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable exportAnalyticsMetricsCallable() { + return exportAnalyticsMetricsCallable; + } + + @Override + public OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable() { + return exportAnalyticsMetricsOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonAnalyticsServiceCallableFactory.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonAnalyticsServiceCallableFactory.java new file mode 100644 index 000000000000..2c2d8bb9dbb5 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonAnalyticsServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the AnalyticsService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonAnalyticsServiceCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonAnalyticsServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonAnalyticsServiceStub.java new file mode 100644 index 000000000000..4f1804a7d394 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonAnalyticsServiceStub.java @@ -0,0 +1,281 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.stub; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2beta.ExportMetadata; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the AnalyticsService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonAnalyticsServiceStub extends AnalyticsServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(ExportMetadata.getDescriptor()) + .add(ExportAnalyticsMetricsResponse.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + exportAnalyticsMetricsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.retail.v2beta.AnalyticsService/ExportAnalyticsMetrics") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{catalog=projects/*/locations/*/catalogs/*}:exportAnalyticsMetrics", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "catalog", request.getCatalog()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearCatalog().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (ExportAnalyticsMetricsRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable + exportAnalyticsMetricsCallable; + private final OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonAnalyticsServiceStub create(AnalyticsServiceStubSettings settings) + throws IOException { + return new HttpJsonAnalyticsServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonAnalyticsServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonAnalyticsServiceStub( + AnalyticsServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonAnalyticsServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonAnalyticsServiceStub( + AnalyticsServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonAnalyticsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonAnalyticsServiceStub( + AnalyticsServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonAnalyticsServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonAnalyticsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected HttpJsonAnalyticsServiceStub( + AnalyticsServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet( + "/v2beta/{name=projects/*/locations/*/catalogs/*/branches/*/operations/*}") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet( + "/v2beta/{name=projects/*/locations/*/catalogs/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v2beta/{name=projects/*/locations/*/operations/*}") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v2beta/{name=projects/*/operations/*}") + .build()) + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v2beta/{name=projects/*/locations/*/catalogs/*}/operations") + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v2beta/{name=projects/*/locations/*}/operations") + .build()) + .addAdditionalBindings( + HttpRule.newBuilder() + .setGet("/v2beta/{name=projects/*}/operations") + .build()) + .build()) + .build()); + + HttpJsonCallSettings + exportAnalyticsMetricsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(exportAnalyticsMetricsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("catalog", String.valueOf(request.getCatalog())); + return builder.build(); + }) + .build(); + + this.exportAnalyticsMetricsCallable = + callableFactory.createUnaryCallable( + exportAnalyticsMetricsTransportSettings, + settings.exportAnalyticsMetricsSettings(), + clientContext); + this.exportAnalyticsMetricsOperationCallable = + callableFactory.createOperationCallable( + exportAnalyticsMetricsTransportSettings, + settings.exportAnalyticsMetricsOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(exportAnalyticsMetricsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable exportAnalyticsMetricsCallable() { + return exportAnalyticsMetricsCallable; + } + + @Override + public OperationCallable< + ExportAnalyticsMetricsRequest, ExportAnalyticsMetricsResponse, ExportMetadata> + exportAnalyticsMetricsOperationCallable() { + return exportAnalyticsMetricsOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ModelServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ModelServiceStubSettings.java index 00ea2853731c..b19d7a17dc12 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ModelServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ModelServiceStubSettings.java @@ -251,6 +251,15 @@ public ModelServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -383,7 +392,11 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put( + "retry_policy_2_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.UNAVAILABLE, StatusCode.Code.DEADLINE_EXCEEDED))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -392,8 +405,17 @@ public static class Builder extends StubSettings.Builder definitions = ImmutableMap.builder(); RetrySettings settings = null; - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_2_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -460,7 +482,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -473,7 +494,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -483,50 +503,50 @@ private static Builder createHttpJsonDefault() { private static Builder initDefaults(Builder builder) { builder .createModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .getModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .pauseModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .resumeModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .deleteModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .listModelsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .updateModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .tuneModelSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); builder .createModelOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Model.class)) @@ -548,8 +568,8 @@ private static Builder initDefaults(Builder builder) { .tuneModelOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(TuneModelResponse.class)) @@ -642,6 +662,15 @@ public UnaryCallSettings.Builder tuneModelSettings( return tuneModelOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ModelServiceStubSettings build() throws IOException { return new ModelServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStubSettings.java index dfc6fd977001..2919d29506c8 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/PredictionServiceStubSettings.java @@ -113,6 +113,15 @@ public PredictionServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -278,7 +287,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -291,7 +299,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -327,6 +334,15 @@ public UnaryCallSettings.Builder predictSetting return predictSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public PredictionServiceStubSettings build() throws IOException { return new PredictionServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStubSettings.java index a8ab4747de7f..f5810819fc9e 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ProductServiceStubSettings.java @@ -337,6 +337,15 @@ public ProductServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -635,7 +644,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -648,7 +656,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -1000,6 +1007,15 @@ public UnaryCallSettings.Builder setInventorySet return removeLocalInventoriesOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ProductServiceStubSettings build() throws IOException { return new ProductServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStubSettings.java index 4bd4aaef90c0..e09495dc7593 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/SearchServiceStubSettings.java @@ -174,6 +174,15 @@ public SearchServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -340,7 +349,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -353,7 +361,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -390,6 +397,15 @@ public Builder applyToAllUnaryMethods( return searchSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public SearchServiceStubSettings build() throws IOException { return new SearchServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStubSettings.java index fcec62184ad0..73436152f95f 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ServingConfigServiceStubSettings.java @@ -235,6 +235,15 @@ public ServingConfigServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -433,7 +442,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -446,7 +454,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -548,6 +555,15 @@ public UnaryCallSettings.Builder removeCont return removeControlSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public ServingConfigServiceStubSettings build() throws IOException { return new ServingConfigServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStubSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStubSettings.java index 004e517c7ff5..84e10f92d9c4 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStubSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/UserEventServiceStubSettings.java @@ -180,6 +180,15 @@ public UserEventServiceStub createStub() throws IOException { "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + /** Returns the default service name. */ @Override public String getServiceName() { @@ -426,7 +435,6 @@ private static Builder createDefault() { builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -439,7 +447,6 @@ private static Builder createHttpJsonDefault() { builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); - builder.setEndpoint(getDefaultEndpoint()); builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); builder.setSwitchToMtlsEndpointAllowed(true); @@ -616,6 +623,15 @@ public UnaryCallSettings.Builder purgeUserEve return rejoinUserEventsOperationSettings; } + /** Returns the endpoint set by the user or the the service's default endpoint. */ + @Override + public String getEndpoint() { + if (super.getEndpoint() != null) { + return super.getEndpoint(); + } + return getDefaultEndpoint(); + } + @Override public UserEventServiceStubSettings build() throws IOException { return new UserEventServiceStubSettings(this); diff --git a/java-retail/google-cloud-retail/src/main/resources/META-INF/native-image/com.google.cloud.retail.v2alpha/reflect-config.json b/java-retail/google-cloud-retail/src/main/resources/META-INF/native-image/com.google.cloud.retail.v2alpha/reflect-config.json index 7aa4215e2537..756d66981aa7 100644 --- a/java-retail/google-cloud-retail/src/main/resources/META-INF/native-image/com.google.cloud.retail.v2alpha/reflect-config.json +++ b/java-retail/google-cloud-retail/src/main/resources/META-INF/native-image/com.google.cloud.retail.v2alpha/reflect-config.json @@ -1268,6 +1268,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.retail.v2alpha.ExportErrorsConfig", "queryAllDeclaredConstructors": true, @@ -2195,6 +2231,60 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.retail.v2alpha.OutputConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2alpha.OutputConfig$BigQueryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2alpha.OutputConfig$BigQueryDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2alpha.OutputConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2alpha.OutputConfig$GcsDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2alpha.OutputConfig$GcsDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.retail.v2alpha.OutputResult", "queryAllDeclaredConstructors": true, diff --git a/java-retail/google-cloud-retail/src/main/resources/META-INF/native-image/com.google.cloud.retail.v2beta/reflect-config.json b/java-retail/google-cloud-retail/src/main/resources/META-INF/native-image/com.google.cloud.retail.v2beta/reflect-config.json index 66a34666da17..0ba316cba888 100644 --- a/java-retail/google-cloud-retail/src/main/resources/META-INF/native-image/com.google.cloud.retail.v2beta/reflect-config.json +++ b/java-retail/google-cloud-retail/src/main/resources/META-INF/native-image/com.google.cloud.retail.v2beta/reflect-config.json @@ -1196,6 +1196,42 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.retail.v2beta.ExportErrorsConfig", "queryAllDeclaredConstructors": true, @@ -1979,6 +2015,60 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.cloud.retail.v2beta.OutputConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2beta.OutputConfig$BigQueryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2beta.OutputConfig$BigQueryDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2beta.OutputConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2beta.OutputConfig$GcsDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.retail.v2beta.OutputConfig$GcsDestination$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.cloud.retail.v2beta.OutputResult", "queryAllDeclaredConstructors": true, diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/AnalyticsServiceClientHttpJsonTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/AnalyticsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..a08b4ec2aac4 --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/AnalyticsServiceClientHttpJsonTest.java @@ -0,0 +1,139 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.retail.v2alpha.stub.HttpJsonAnalyticsServiceStub; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.rpc.Status; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AnalyticsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static AnalyticsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAnalyticsServiceStub.getMethodDescriptors(), + AnalyticsServiceSettings.getDefaultEndpoint()); + AnalyticsServiceSettings settings = + AnalyticsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AnalyticsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AnalyticsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void exportAnalyticsMetricsTest() throws Exception { + ExportAnalyticsMetricsResponse expectedResponse = + ExportAnalyticsMetricsResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .setErrorsConfig(ExportErrorsConfig.newBuilder().build()) + .setOutputResult(OutputResult.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportAnalyticsMetricsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("projects/project-6372/locations/location-6372/catalogs/catalog-6372") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + + ExportAnalyticsMetricsResponse actualResponse = + client.exportAnalyticsMetricsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void exportAnalyticsMetricsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("projects/project-6372/locations/location-6372/catalogs/catalog-6372") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + client.exportAnalyticsMetricsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/AnalyticsServiceClientTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/AnalyticsServiceClientTest.java new file mode 100644 index 000000000000..6f951fcc2726 --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/AnalyticsServiceClientTest.java @@ -0,0 +1,145 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AnalyticsServiceClientTest { + private static MockAnalyticsService mockAnalyticsService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AnalyticsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockAnalyticsService = new MockAnalyticsService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockAnalyticsService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AnalyticsServiceSettings settings = + AnalyticsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AnalyticsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void exportAnalyticsMetricsTest() throws Exception { + ExportAnalyticsMetricsResponse expectedResponse = + ExportAnalyticsMetricsResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .setErrorsConfig(ExportErrorsConfig.newBuilder().build()) + .setOutputResult(OutputResult.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportAnalyticsMetricsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAnalyticsService.addResponse(resultOperation); + + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("catalog555704345") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + + ExportAnalyticsMetricsResponse actualResponse = + client.exportAnalyticsMetricsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExportAnalyticsMetricsRequest actualRequest = + ((ExportAnalyticsMetricsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getCatalog(), actualRequest.getCatalog()); + Assert.assertEquals(request.getOutputConfig(), actualRequest.getOutputConfig()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void exportAnalyticsMetricsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsService.addException(exception); + + try { + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("catalog555704345") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + client.exportAnalyticsMetricsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockAnalyticsService.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockAnalyticsService.java new file mode 100644 index 000000000000..51198cf85b67 --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockAnalyticsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAnalyticsService implements MockGrpcService { + private final MockAnalyticsServiceImpl serviceImpl; + + public MockAnalyticsService() { + serviceImpl = new MockAnalyticsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockAnalyticsServiceImpl.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockAnalyticsServiceImpl.java new file mode 100644 index 000000000000..6b1048768d6d --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2alpha/MockAnalyticsServiceImpl.java @@ -0,0 +1,82 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha; + +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2alpha.AnalyticsServiceGrpc.AnalyticsServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAnalyticsServiceImpl extends AnalyticsServiceImplBase { + private List requests; + private Queue responses; + + public MockAnalyticsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void exportAnalyticsMetrics( + ExportAnalyticsMetricsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ExportAnalyticsMetrics, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/AnalyticsServiceClientHttpJsonTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/AnalyticsServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..bd3d60336f60 --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/AnalyticsServiceClientHttpJsonTest.java @@ -0,0 +1,139 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.retail.v2beta.stub.HttpJsonAnalyticsServiceStub; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.rpc.Status; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AnalyticsServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static AnalyticsServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonAnalyticsServiceStub.getMethodDescriptors(), + AnalyticsServiceSettings.getDefaultEndpoint()); + AnalyticsServiceSettings settings = + AnalyticsServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + AnalyticsServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AnalyticsServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void exportAnalyticsMetricsTest() throws Exception { + ExportAnalyticsMetricsResponse expectedResponse = + ExportAnalyticsMetricsResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .setErrorsConfig(ExportErrorsConfig.newBuilder().build()) + .setOutputResult(OutputResult.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportAnalyticsMetricsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("projects/project-6372/locations/location-6372/catalogs/catalog-6372") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + + ExportAnalyticsMetricsResponse actualResponse = + client.exportAnalyticsMetricsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void exportAnalyticsMetricsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("projects/project-6372/locations/location-6372/catalogs/catalog-6372") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + client.exportAnalyticsMetricsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/AnalyticsServiceClientTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/AnalyticsServiceClientTest.java new file mode 100644 index 000000000000..f545a7ea47d6 --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/AnalyticsServiceClientTest.java @@ -0,0 +1,145 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.rpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class AnalyticsServiceClientTest { + private static MockAnalyticsService mockAnalyticsService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private AnalyticsServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockAnalyticsService = new MockAnalyticsService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockAnalyticsService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AnalyticsServiceSettings settings = + AnalyticsServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AnalyticsServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void exportAnalyticsMetricsTest() throws Exception { + ExportAnalyticsMetricsResponse expectedResponse = + ExportAnalyticsMetricsResponse.newBuilder() + .addAllErrorSamples(new ArrayList()) + .setErrorsConfig(ExportErrorsConfig.newBuilder().build()) + .setOutputResult(OutputResult.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportAnalyticsMetricsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAnalyticsService.addResponse(resultOperation); + + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("catalog555704345") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + + ExportAnalyticsMetricsResponse actualResponse = + client.exportAnalyticsMetricsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAnalyticsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExportAnalyticsMetricsRequest actualRequest = + ((ExportAnalyticsMetricsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getCatalog(), actualRequest.getCatalog()); + Assert.assertEquals(request.getOutputConfig(), actualRequest.getOutputConfig()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void exportAnalyticsMetricsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAnalyticsService.addException(exception); + + try { + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("catalog555704345") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + client.exportAnalyticsMetricsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockAnalyticsService.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockAnalyticsService.java new file mode 100644 index 000000000000..220f1188516c --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockAnalyticsService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAnalyticsService implements MockGrpcService { + private final MockAnalyticsServiceImpl serviceImpl; + + public MockAnalyticsService() { + serviceImpl = new MockAnalyticsServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockAnalyticsServiceImpl.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockAnalyticsServiceImpl.java new file mode 100644 index 000000000000..a0151f74fa9f --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockAnalyticsServiceImpl.java @@ -0,0 +1,82 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta; + +import com.google.api.core.BetaApi; +import com.google.cloud.retail.v2beta.AnalyticsServiceGrpc.AnalyticsServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockAnalyticsServiceImpl extends AnalyticsServiceImplBase { + private List requests; + private Queue responses; + + public MockAnalyticsServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void exportAnalyticsMetrics( + ExportAnalyticsMetricsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ExportAnalyticsMetrics, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-retail/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceGrpc.java b/java-retail/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceGrpc.java new file mode 100644 index 000000000000..02299f0fe743 --- /dev/null +++ b/java-retail/grpc-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceGrpc.java @@ -0,0 +1,391 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.retail.v2alpha; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for managing & accessing retail search business metric.
+ * Retail recommendation business metric is currently not available.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2alpha/analytics_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AnalyticsServiceGrpc { + + private AnalyticsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.retail.v2alpha.AnalyticsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest, + com.google.longrunning.Operation> + getExportAnalyticsMetricsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ExportAnalyticsMetrics", + requestType = com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest, + com.google.longrunning.Operation> + getExportAnalyticsMetricsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest, + com.google.longrunning.Operation> + getExportAnalyticsMetricsMethod; + if ((getExportAnalyticsMetricsMethod = AnalyticsServiceGrpc.getExportAnalyticsMetricsMethod) + == null) { + synchronized (AnalyticsServiceGrpc.class) { + if ((getExportAnalyticsMetricsMethod = AnalyticsServiceGrpc.getExportAnalyticsMetricsMethod) + == null) { + AnalyticsServiceGrpc.getExportAnalyticsMetricsMethod = + getExportAnalyticsMetricsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ExportAnalyticsMetrics")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsServiceMethodDescriptorSupplier("ExportAnalyticsMetrics")) + .build(); + } + } + } + return getExportAnalyticsMetricsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AnalyticsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AnalyticsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceStub(channel, callOptions); + } + }; + return AnalyticsServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AnalyticsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AnalyticsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceBlockingStub(channel, callOptions); + } + }; + return AnalyticsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AnalyticsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AnalyticsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceFutureStub(channel, callOptions); + } + }; + return AnalyticsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing & accessing retail search business metric.
+   * Retail recommendation business metric is currently not available.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Exports analytics metrics.
+     * `Operation.response` is of type `ExportAnalyticsMetricsResponse`.
+     * `Operation.metadata` is of type `ExportMetadata`.
+     * 
+ */ + default void exportAnalyticsMetrics( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getExportAnalyticsMetricsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service AnalyticsService. + * + *
+   * Service for managing & accessing retail search business metric.
+   * Retail recommendation business metric is currently not available.
+   * 
+ */ + public abstract static class AnalyticsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return AnalyticsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service AnalyticsService. + * + *
+   * Service for managing & accessing retail search business metric.
+   * Retail recommendation business metric is currently not available.
+   * 
+ */ + public static final class AnalyticsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private AnalyticsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AnalyticsServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports analytics metrics.
+     * `Operation.response` is of type `ExportAnalyticsMetricsResponse`.
+     * `Operation.metadata` is of type `ExportMetadata`.
+     * 
+ */ + public void exportAnalyticsMetrics( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getExportAnalyticsMetricsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service AnalyticsService. + * + *
+   * Service for managing & accessing retail search business metric.
+   * Retail recommendation business metric is currently not available.
+   * 
+ */ + public static final class AnalyticsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AnalyticsServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AnalyticsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports analytics metrics.
+     * `Operation.response` is of type `ExportAnalyticsMetricsResponse`.
+     * `Operation.metadata` is of type `ExportMetadata`.
+     * 
+ */ + public com.google.longrunning.Operation exportAnalyticsMetrics( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getExportAnalyticsMetricsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service AnalyticsService. + * + *
+   * Service for managing & accessing retail search business metric.
+   * Retail recommendation business metric is currently not available.
+   * 
+ */ + public static final class AnalyticsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AnalyticsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AnalyticsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports analytics metrics.
+     * `Operation.response` is of type `ExportAnalyticsMetricsResponse`.
+     * `Operation.metadata` is of type `ExportMetadata`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + exportAnalyticsMetrics( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getExportAnalyticsMetricsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_EXPORT_ANALYTICS_METRICS = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_EXPORT_ANALYTICS_METRICS: + serviceImpl.exportAnalyticsMetrics( + (com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getExportAnalyticsMetricsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest, + com.google.longrunning.Operation>(service, METHODID_EXPORT_ANALYTICS_METRICS))) + .build(); + } + + private abstract static class AnalyticsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AnalyticsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2alpha.AnalyticsServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AnalyticsService"); + } + } + + private static final class AnalyticsServiceFileDescriptorSupplier + extends AnalyticsServiceBaseDescriptorSupplier { + AnalyticsServiceFileDescriptorSupplier() {} + } + + private static final class AnalyticsServiceMethodDescriptorSupplier + extends AnalyticsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + AnalyticsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (AnalyticsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AnalyticsServiceFileDescriptorSupplier()) + .addMethod(getExportAnalyticsMetricsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceGrpc.java b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceGrpc.java new file mode 100644 index 000000000000..d5e6e8635e51 --- /dev/null +++ b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceGrpc.java @@ -0,0 +1,390 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.retail.v2beta; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Service for managing & accessing retail search business metric.
+ * Retail recommendation business metric is currently not available.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2beta/analytics_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class AnalyticsServiceGrpc { + + private AnalyticsServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.cloud.retail.v2beta.AnalyticsService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest, + com.google.longrunning.Operation> + getExportAnalyticsMetricsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ExportAnalyticsMetrics", + requestType = com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest, + com.google.longrunning.Operation> + getExportAnalyticsMetricsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest, + com.google.longrunning.Operation> + getExportAnalyticsMetricsMethod; + if ((getExportAnalyticsMetricsMethod = AnalyticsServiceGrpc.getExportAnalyticsMetricsMethod) + == null) { + synchronized (AnalyticsServiceGrpc.class) { + if ((getExportAnalyticsMetricsMethod = AnalyticsServiceGrpc.getExportAnalyticsMetricsMethod) + == null) { + AnalyticsServiceGrpc.getExportAnalyticsMetricsMethod = + getExportAnalyticsMetricsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ExportAnalyticsMetrics")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new AnalyticsServiceMethodDescriptorSupplier("ExportAnalyticsMetrics")) + .build(); + } + } + } + return getExportAnalyticsMetricsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AnalyticsServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AnalyticsServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceStub(channel, callOptions); + } + }; + return AnalyticsServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AnalyticsServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AnalyticsServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceBlockingStub(channel, callOptions); + } + }; + return AnalyticsServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AnalyticsServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AnalyticsServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceFutureStub(channel, callOptions); + } + }; + return AnalyticsServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for managing & accessing retail search business metric.
+   * Retail recommendation business metric is currently not available.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Exports analytics metrics.
+     * `Operation.response` is of type `ExportAnalyticsMetricsResponse`.
+     * `Operation.metadata` is of type `ExportMetadata`.
+     * 
+ */ + default void exportAnalyticsMetrics( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getExportAnalyticsMetricsMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service AnalyticsService. + * + *
+   * Service for managing & accessing retail search business metric.
+   * Retail recommendation business metric is currently not available.
+   * 
+ */ + public abstract static class AnalyticsServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return AnalyticsServiceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service AnalyticsService. + * + *
+   * Service for managing & accessing retail search business metric.
+   * Retail recommendation business metric is currently not available.
+   * 
+ */ + public static final class AnalyticsServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private AnalyticsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AnalyticsServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports analytics metrics.
+     * `Operation.response` is of type `ExportAnalyticsMetricsResponse`.
+     * `Operation.metadata` is of type `ExportMetadata`.
+     * 
+ */ + public void exportAnalyticsMetrics( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getExportAnalyticsMetricsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service AnalyticsService. + * + *
+   * Service for managing & accessing retail search business metric.
+   * Retail recommendation business metric is currently not available.
+   * 
+ */ + public static final class AnalyticsServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AnalyticsServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AnalyticsServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports analytics metrics.
+     * `Operation.response` is of type `ExportAnalyticsMetricsResponse`.
+     * `Operation.metadata` is of type `ExportMetadata`.
+     * 
+ */ + public com.google.longrunning.Operation exportAnalyticsMetrics( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getExportAnalyticsMetricsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service AnalyticsService. + * + *
+   * Service for managing & accessing retail search business metric.
+   * Retail recommendation business metric is currently not available.
+   * 
+ */ + public static final class AnalyticsServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AnalyticsServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AnalyticsServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AnalyticsServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports analytics metrics.
+     * `Operation.response` is of type `ExportAnalyticsMetricsResponse`.
+     * `Operation.metadata` is of type `ExportMetadata`.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + exportAnalyticsMetrics( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getExportAnalyticsMetricsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_EXPORT_ANALYTICS_METRICS = 0; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_EXPORT_ANALYTICS_METRICS: + serviceImpl.exportAnalyticsMetrics( + (com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getExportAnalyticsMetricsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest, + com.google.longrunning.Operation>(service, METHODID_EXPORT_ANALYTICS_METRICS))) + .build(); + } + + private abstract static class AnalyticsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AnalyticsServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2beta.AnalyticsServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AnalyticsService"); + } + } + + private static final class AnalyticsServiceFileDescriptorSupplier + extends AnalyticsServiceBaseDescriptorSupplier { + AnalyticsServiceFileDescriptorSupplier() {} + } + + private static final class AnalyticsServiceMethodDescriptorSupplier + extends AnalyticsServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + AnalyticsServiceMethodDescriptorSupplier(java.lang.String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (AnalyticsServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AnalyticsServiceFileDescriptorSupplier()) + .addMethod(getExportAnalyticsMetricsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceProto.java b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceProto.java new file mode 100644 index 000000000000..6d4a787792c8 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/AnalyticsServiceProto.java @@ -0,0 +1,91 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2alpha/analytics_service.proto + +package com.google.cloud.retail.v2alpha; + +public final class AnalyticsServiceProto { + private AnalyticsServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n3google/cloud/retail/v2alpha/analytics_" + + "service.proto\022\033google.cloud.retail.v2alp" + + "ha\032\034google/api/annotations.proto\032\027google" + + "/api/client.proto\032\037google/api/field_beha" + + "vior.proto\032\031google/api/resource.proto\032/g" + + "oogle/cloud/retail/v2alpha/export_config" + + ".proto\032#google/longrunning/operations.pr" + + "oto2\227\003\n\020AnalyticsService\022\267\002\n\026ExportAnaly" + + "ticsMetrics\022:.google.cloud.retail.v2alph" + + "a.ExportAnalyticsMetricsRequest\032\035.google" + + ".longrunning.Operation\"\301\001\312Ah\n:google.clo" + + "ud.retail.v2alpha.ExportAnalyticsMetrics" + + "Response\022*google.cloud.retail.v2alpha.Ex" + + "portMetadata\202\323\344\223\002P\"K/v2alpha/{catalog=pr" + + "ojects/*/locations/*/catalogs/*}:exportA" + + "nalyticsMetrics:\001*\032I\312A\025retail.googleapis" + + ".com\322A.https://www.googleapis.com/auth/c" + + "loud-platformB\331\001\n\037com.google.cloud.retai" + + "l.v2alphaB\025AnalyticsServiceProtoP\001Z7clou" + + "d.google.com/go/retail/apiv2alpha/retail" + + "pb;retailpb\242\002\006RETAIL\252\002\033Google.Cloud.Reta" + + "il.V2Alpha\312\002\033Google\\Cloud\\Retail\\V2alpha" + + "\352\002\036Google::Cloud::Retail::V2alphab\006proto" + + "3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2alpha.ExportConfigProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.retail.v2alpha.ExportConfigProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsRequest.java b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsRequest.java new file mode 100644 index 000000000000..f74f864a4b8b --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsRequest.java @@ -0,0 +1,1220 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Request message for the `ExportAnalyticsMetrics` method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest} + */ +public final class ExportAnalyticsMetricsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest) + ExportAnalyticsMetricsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportAnalyticsMetricsRequest.newBuilder() to construct. + private ExportAnalyticsMetricsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportAnalyticsMetricsRequest() { + catalog_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportAnalyticsMetricsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest.class, + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object catalog_ = ""; + /** + * + * + *
+   * Required. Full resource name of the parent catalog.
+   * Expected format: `projects/*/locations/*/catalogs/*`
+   * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The catalog. + */ + @java.lang.Override + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of the parent catalog.
+   * Expected format: `projects/*/locations/*/catalogs/*`
+   * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for catalog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.OutputConfig outputConfig_; + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.retail.v2alpha.OutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return outputConfig_ == null + ? com.google.cloud.retail.v2alpha.OutputConfig.getDefaultInstance() + : outputConfig_; + } + + public static final int FILTER_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * A filtering expression to specify restrictions on returned metrics.
+   * The expression is a sequence of terms. Each term applies a restriction to
+   * the returned metrics. Use this expression to restrict results to a
+   * specific time range.
+   *
+   *   Currently we expect only one types of fields:
+   *
+   *    * `timestamp`: This can be specified twice, once with a
+   *      less than operator and once with a greater than operator. The
+   *      `timestamp` restriction should result in one, contiguous, valid,
+   *      `timestamp` range.
+   *
+   *   Some examples of valid filters expressions:
+   *
+   *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+   *             timestamp < "2012-04-23T18:30:43.511Z"`
+   *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+   * 
+ * + * string filter = 3; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filtering expression to specify restrictions on returned metrics.
+   * The expression is a sequence of terms. Each term applies a restriction to
+   * the returned metrics. Use this expression to restrict results to a
+   * specific time range.
+   *
+   *   Currently we expect only one types of fields:
+   *
+   *    * `timestamp`: This can be specified twice, once with a
+   *      less than operator and once with a greater than operator. The
+   *      `timestamp` restriction should result in one, contiguous, valid,
+   *      `timestamp` range.
+   *
+   *   Some examples of valid filters expressions:
+   *
+   *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+   *             timestamp < "2012-04-23T18:30:43.511Z"`
+   *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+   * 
+ * + * string filter = 3; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(catalog_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalog_); + } + if (outputConfig_ != null) { + output.writeMessage(2, getOutputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(catalog_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalog_); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOutputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest other = + (com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest) obj; + + if (!getCatalog().equals(other.getCatalog())) return false; + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig().equals(other.getOutputConfig())) return false; + } + if (!getFilter().equals(other.getFilter())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().hashCode(); + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `ExportAnalyticsMetrics` method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest) + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest.class, + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + catalog_ = ""; + outputConfig_ = null; + if (outputConfigBuilder_ != null) { + outputConfigBuilder_.dispose(); + outputConfigBuilder_ = null; + } + filter_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest build() { + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest buildPartial() { + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest result = + new com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.catalog_ = catalog_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.outputConfig_ = + outputConfigBuilder_ == null ? outputConfig_ : outputConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.filter_ = filter_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest) { + return mergeFrom((com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest other) { + if (other + == com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest.getDefaultInstance()) + return this; + if (!other.getCatalog().isEmpty()) { + catalog_ = other.catalog_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + catalog_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getOutputConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object catalog_ = ""; + /** + * + * + *
+     * Required. Full resource name of the parent catalog.
+     * Expected format: `projects/*/locations/*/catalogs/*`
+     * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The catalog. + */ + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of the parent catalog.
+     * Expected format: `projects/*/locations/*/catalogs/*`
+     * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for catalog. + */ + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of the parent catalog.
+     * Expected format: `projects/*/locations/*/catalogs/*`
+     * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + catalog_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the parent catalog.
+     * Expected format: `projects/*/locations/*/catalogs/*`
+     * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCatalog() { + catalog_ = getDefaultInstance().getCatalog(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the parent catalog.
+     * Expected format: `projects/*/locations/*/catalogs/*`
+     * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + catalog_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2alpha.OutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputConfig, + com.google.cloud.retail.v2alpha.OutputConfig.Builder, + com.google.cloud.retail.v2alpha.OutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + public com.google.cloud.retail.v2alpha.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.retail.v2alpha.OutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig(com.google.cloud.retail.v2alpha.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + } else { + outputConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig( + com.google.cloud.retail.v2alpha.OutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeOutputConfig(com.google.cloud.retail.v2alpha.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && outputConfig_ != null + && outputConfig_ != com.google.cloud.retail.v2alpha.OutputConfig.getDefaultInstance()) { + getOutputConfigBuilder().mergeFrom(value); + } else { + outputConfig_ = value; + } + } else { + outputConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearOutputConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + outputConfig_ = null; + if (outputConfigBuilder_ != null) { + outputConfigBuilder_.dispose(); + outputConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.OutputConfig.Builder getOutputConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2alpha.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.retail.v2alpha.OutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputConfig, + com.google.cloud.retail.v2alpha.OutputConfig.Builder, + com.google.cloud.retail.v2alpha.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputConfig, + com.google.cloud.retail.v2alpha.OutputConfig.Builder, + com.google.cloud.retail.v2alpha.OutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filtering expression to specify restrictions on returned metrics.
+     * The expression is a sequence of terms. Each term applies a restriction to
+     * the returned metrics. Use this expression to restrict results to a
+     * specific time range.
+     *
+     *   Currently we expect only one types of fields:
+     *
+     *    * `timestamp`: This can be specified twice, once with a
+     *      less than operator and once with a greater than operator. The
+     *      `timestamp` restriction should result in one, contiguous, valid,
+     *      `timestamp` range.
+     *
+     *   Some examples of valid filters expressions:
+     *
+     *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+     *             timestamp < "2012-04-23T18:30:43.511Z"`
+     *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+     * 
+ * + * string filter = 3; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filtering expression to specify restrictions on returned metrics.
+     * The expression is a sequence of terms. Each term applies a restriction to
+     * the returned metrics. Use this expression to restrict results to a
+     * specific time range.
+     *
+     *   Currently we expect only one types of fields:
+     *
+     *    * `timestamp`: This can be specified twice, once with a
+     *      less than operator and once with a greater than operator. The
+     *      `timestamp` restriction should result in one, contiguous, valid,
+     *      `timestamp` range.
+     *
+     *   Some examples of valid filters expressions:
+     *
+     *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+     *             timestamp < "2012-04-23T18:30:43.511Z"`
+     *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+     * 
+ * + * string filter = 3; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filtering expression to specify restrictions on returned metrics.
+     * The expression is a sequence of terms. Each term applies a restriction to
+     * the returned metrics. Use this expression to restrict results to a
+     * specific time range.
+     *
+     *   Currently we expect only one types of fields:
+     *
+     *    * `timestamp`: This can be specified twice, once with a
+     *      less than operator and once with a greater than operator. The
+     *      `timestamp` restriction should result in one, contiguous, valid,
+     *      `timestamp` range.
+     *
+     *   Some examples of valid filters expressions:
+     *
+     *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+     *             timestamp < "2012-04-23T18:30:43.511Z"`
+     *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+     * 
+ * + * string filter = 3; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A filtering expression to specify restrictions on returned metrics.
+     * The expression is a sequence of terms. Each term applies a restriction to
+     * the returned metrics. Use this expression to restrict results to a
+     * specific time range.
+     *
+     *   Currently we expect only one types of fields:
+     *
+     *    * `timestamp`: This can be specified twice, once with a
+     *      less than operator and once with a greater than operator. The
+     *      `timestamp` restriction should result in one, contiguous, valid,
+     *      `timestamp` range.
+     *
+     *   Some examples of valid filters expressions:
+     *
+     *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+     *             timestamp < "2012-04-23T18:30:43.511Z"`
+     *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+     * 
+ * + * string filter = 3; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A filtering expression to specify restrictions on returned metrics.
+     * The expression is a sequence of terms. Each term applies a restriction to
+     * the returned metrics. Use this expression to restrict results to a
+     * specific time range.
+     *
+     *   Currently we expect only one types of fields:
+     *
+     *    * `timestamp`: This can be specified twice, once with a
+     *      less than operator and once with a greater than operator. The
+     *      `timestamp` restriction should result in one, contiguous, valid,
+     *      `timestamp` range.
+     *
+     *   Some examples of valid filters expressions:
+     *
+     *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+     *             timestamp < "2012-04-23T18:30:43.511Z"`
+     *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+     * 
+ * + * string filter = 3; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest) + private static final com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest(); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportAnalyticsMetricsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsRequestOrBuilder.java new file mode 100644 index 000000000000..fb0fb8a08d90 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsRequestOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ExportAnalyticsMetricsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of the parent catalog.
+   * Expected format: `projects/*/locations/*/catalogs/*`
+   * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The catalog. + */ + java.lang.String getCatalog(); + /** + * + * + *
+   * Required. Full resource name of the parent catalog.
+   * Expected format: `projects/*/locations/*/catalogs/*`
+   * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for catalog. + */ + com.google.protobuf.ByteString getCatalogBytes(); + + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + com.google.cloud.retail.v2alpha.OutputConfig getOutputConfig(); + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2alpha.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2alpha.OutputConfigOrBuilder getOutputConfigOrBuilder(); + + /** + * + * + *
+   * A filtering expression to specify restrictions on returned metrics.
+   * The expression is a sequence of terms. Each term applies a restriction to
+   * the returned metrics. Use this expression to restrict results to a
+   * specific time range.
+   *
+   *   Currently we expect only one types of fields:
+   *
+   *    * `timestamp`: This can be specified twice, once with a
+   *      less than operator and once with a greater than operator. The
+   *      `timestamp` restriction should result in one, contiguous, valid,
+   *      `timestamp` range.
+   *
+   *   Some examples of valid filters expressions:
+   *
+   *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+   *             timestamp < "2012-04-23T18:30:43.511Z"`
+   *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+   * 
+ * + * string filter = 3; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filtering expression to specify restrictions on returned metrics.
+   * The expression is a sequence of terms. Each term applies a restriction to
+   * the returned metrics. Use this expression to restrict results to a
+   * specific time range.
+   *
+   *   Currently we expect only one types of fields:
+   *
+   *    * `timestamp`: This can be specified twice, once with a
+   *      less than operator and once with a greater than operator. The
+   *      `timestamp` restriction should result in one, contiguous, valid,
+   *      `timestamp` range.
+   *
+   *   Some examples of valid filters expressions:
+   *
+   *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+   *             timestamp < "2012-04-23T18:30:43.511Z"`
+   *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+   * 
+ * + * string filter = 3; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsResponse.java b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsResponse.java new file mode 100644 index 000000000000..248f87ec118a --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsResponse.java @@ -0,0 +1,1467 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * Response of the ExportAnalyticsMetricsRequest. If the long running
+ * operation was successful, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse} + */ +public final class ExportAnalyticsMetricsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse) + ExportAnalyticsMetricsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportAnalyticsMetricsResponse.newBuilder() to construct. + private ExportAnalyticsMetricsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportAnalyticsMetricsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportAnalyticsMetricsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse.class, + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2alpha.ExportErrorsConfig errorsConfig_; + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + + public static final int OUTPUT_RESULT_FIELD_NUMBER = 3; + private com.google.cloud.retail.v2alpha.OutputResult outputResult_; + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + * + * @return Whether the outputResult field is set. + */ + @java.lang.Override + public boolean hasOutputResult() { + return outputResult_ != null; + } + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + * + * @return The outputResult. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputResult getOutputResult() { + return outputResult_ == null + ? com.google.cloud.retail.v2alpha.OutputResult.getDefaultInstance() + : outputResult_; + } + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputResultOrBuilder getOutputResultOrBuilder() { + return outputResult_ == null + ? com.google.cloud.retail.v2alpha.OutputResult.getDefaultInstance() + : outputResult_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + if (outputResult_ != null) { + output.writeMessage(3, getOutputResult()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + if (outputResult_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getOutputResult()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse other = + (com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) return false; + } + if (hasOutputResult() != other.hasOutputResult()) return false; + if (hasOutputResult()) { + if (!getOutputResult().equals(other.getOutputResult())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + if (hasOutputResult()) { + hash = (37 * hash) + OUTPUT_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getOutputResult().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of the ExportAnalyticsMetricsRequest. If the long running
+   * operation was successful, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse) + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse.class, + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + } else { + errorSamples_ = null; + errorSamplesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + errorsConfig_ = null; + if (errorsConfigBuilder_ != null) { + errorsConfigBuilder_.dispose(); + errorsConfigBuilder_ = null; + } + outputResult_ = null; + if (outputResultBuilder_ != null) { + outputResultBuilder_.dispose(); + outputResultBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse build() { + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse buildPartial() { + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse result = + new com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse result) { + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorsConfig_ = + errorsConfigBuilder_ == null ? errorsConfig_ : errorsConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.outputResult_ = + outputResultBuilder_ == null ? outputResult_ : outputResultBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse) { + return mergeFrom((com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse other) { + if (other + == com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + if (other.hasOutputResult()) { + mergeOutputResult(other.getOutputResult()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.rpc.Status m = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(m); + } else { + errorSamplesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage(getErrorsConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getOutputResultFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.retail.v2alpha.ExportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ExportErrorsConfig, + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2alpha.ExportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2alpha.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + } else { + errorsConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2alpha.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && errorsConfig_ != null + && errorsConfig_ + != com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance()) { + getErrorsConfigBuilder().mergeFrom(value); + } else { + errorsConfig_ = value; + } + } else { + errorsConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + errorsConfig_ = null; + if (errorsConfigBuilder_ != null) { + errorsConfigBuilder_.dispose(); + errorsConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder getErrorsConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2alpha.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ExportErrorsConfig, + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.ExportErrorsConfig, + com.google.cloud.retail.v2alpha.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + private com.google.cloud.retail.v2alpha.OutputResult outputResult_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputResult, + com.google.cloud.retail.v2alpha.OutputResult.Builder, + com.google.cloud.retail.v2alpha.OutputResultOrBuilder> + outputResultBuilder_; + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + * + * @return Whether the outputResult field is set. + */ + public boolean hasOutputResult() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + * + * @return The outputResult. + */ + public com.google.cloud.retail.v2alpha.OutputResult getOutputResult() { + if (outputResultBuilder_ == null) { + return outputResult_ == null + ? com.google.cloud.retail.v2alpha.OutputResult.getDefaultInstance() + : outputResult_; + } else { + return outputResultBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + */ + public Builder setOutputResult(com.google.cloud.retail.v2alpha.OutputResult value) { + if (outputResultBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputResult_ = value; + } else { + outputResultBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + */ + public Builder setOutputResult( + com.google.cloud.retail.v2alpha.OutputResult.Builder builderForValue) { + if (outputResultBuilder_ == null) { + outputResult_ = builderForValue.build(); + } else { + outputResultBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + */ + public Builder mergeOutputResult(com.google.cloud.retail.v2alpha.OutputResult value) { + if (outputResultBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && outputResult_ != null + && outputResult_ != com.google.cloud.retail.v2alpha.OutputResult.getDefaultInstance()) { + getOutputResultBuilder().mergeFrom(value); + } else { + outputResult_ = value; + } + } else { + outputResultBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + */ + public Builder clearOutputResult() { + bitField0_ = (bitField0_ & ~0x00000004); + outputResult_ = null; + if (outputResultBuilder_ != null) { + outputResultBuilder_.dispose(); + outputResultBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + */ + public com.google.cloud.retail.v2alpha.OutputResult.Builder getOutputResultBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getOutputResultFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + */ + public com.google.cloud.retail.v2alpha.OutputResultOrBuilder getOutputResultOrBuilder() { + if (outputResultBuilder_ != null) { + return outputResultBuilder_.getMessageOrBuilder(); + } else { + return outputResult_ == null + ? com.google.cloud.retail.v2alpha.OutputResult.getDefaultInstance() + : outputResult_; + } + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputResult, + com.google.cloud.retail.v2alpha.OutputResult.Builder, + com.google.cloud.retail.v2alpha.OutputResultOrBuilder> + getOutputResultFieldBuilder() { + if (outputResultBuilder_ == null) { + outputResultBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputResult, + com.google.cloud.retail.v2alpha.OutputResult.Builder, + com.google.cloud.retail.v2alpha.OutputResultOrBuilder>( + getOutputResult(), getParentForChildren(), isClean()); + outputResult_ = null; + } + return outputResultBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse) + private static final com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse(); + } + + public static com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportAnalyticsMetricsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsResponseOrBuilder.java b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsResponseOrBuilder.java new file mode 100644 index 000000000000..0f6f99ae2c41 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportAnalyticsMetricsResponseOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface ExportAnalyticsMetricsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2alpha.ExportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2alpha.ExportErrorsConfig errors_config = 2; + */ + com.google.cloud.retail.v2alpha.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); + + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + * + * @return Whether the outputResult field is set. + */ + boolean hasOutputResult(); + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + * + * @return The outputResult. + */ + com.google.cloud.retail.v2alpha.OutputResult getOutputResult(); + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputResult output_result = 3; + */ + com.google.cloud.retail.v2alpha.OutputResultOrBuilder getOutputResultOrBuilder(); +} diff --git a/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportConfigProto.java b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportConfigProto.java index 3f71eff9ab35..45a0952f38fe 100644 --- a/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportConfigProto.java +++ b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/ExportConfigProto.java @@ -27,10 +27,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_OutputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_OutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_OutputConfig_GcsDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_OutputConfig_GcsDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_OutputConfig_BigQueryDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_OutputConfig_BigQueryDestination_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2alpha_ExportMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -43,6 +59,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2alpha_OutputResult_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -68,34 +88,53 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "fig.proto\022\033google.cloud.retail.v2alpha\032\037" + "google/api/field_behavior.proto\032\031google/" + "api/resource.proto\032\037google/protobuf/time" - + "stamp.proto\032\027google/rpc/status.proto\"9\n\022" - + "ExportErrorsConfig\022\024\n\ngcs_prefix\030\001 \001(\tH\000" - + "B\r\n\013destination\"r\n\016ExportMetadata\022/\n\013cre" - + "ate_time\030\001 \001(\0132\032.google.protobuf.Timesta" - + "mp\022/\n\013update_time\030\002 \001(\0132\032.google.protobu" - + "f.Timestamp\"\315\001\n\026ExportProductsResponse\022)" - + "\n\rerror_samples\030\001 \003(\0132\022.google.rpc.Statu" - + "s\022F\n\rerrors_config\030\002 \001(\0132/.google.cloud." - + "retail.v2alpha.ExportErrorsConfig\022@\n\rout" - + "put_result\030\003 \001(\0132).google.cloud.retail.v" - + "2alpha.OutputResult\"\317\001\n\030ExportUserEvents" - + "Response\022)\n\rerror_samples\030\001 \003(\0132\022.google" - + ".rpc.Status\022F\n\rerrors_config\030\002 \001(\0132/.goo" - + "gle.cloud.retail.v2alpha.ExportErrorsCon" - + "fig\022@\n\routput_result\030\003 \001(\0132).google.clou" - + "d.retail.v2alpha.OutputResult\"\234\001\n\014Output" - + "Result\022J\n\017bigquery_result\030\001 \003(\01321.google" - + ".cloud.retail.v2alpha.BigQueryOutputResu" - + "lt\022@\n\ngcs_result\030\002 \003(\0132,.google.cloud.re" - + "tail.v2alpha.GcsOutputResult\"<\n\024BigQuery" - + "OutputResult\022\022\n\ndataset_id\030\001 \001(\t\022\020\n\010tabl" - + "e_id\030\002 \001(\t\"%\n\017GcsOutputResult\022\022\n\noutput_" - + "uri\030\001 \001(\tB\325\001\n\037com.google.cloud.retail.v2" - + "alphaB\021ExportConfigProtoP\001Z7cloud.google" - + ".com/go/retail/apiv2alpha/retailpb;retai" - + "lpb\242\002\006RETAIL\252\002\033Google.Cloud.Retail.V2Alp" - + "ha\312\002\033Google\\Cloud\\Retail\\V2alpha\352\002\036Googl" - + "e::Cloud::Retail::V2alphab\006proto3" + + "stamp.proto\032\027google/rpc/status.proto\"\356\002\n" + + "\014OutputConfig\022S\n\017gcs_destination\030\001 \001(\01328" + + ".google.cloud.retail.v2alpha.OutputConfi" + + "g.GcsDestinationH\000\022]\n\024bigquery_destinati" + + "on\030\002 \001(\0132=.google.cloud.retail.v2alpha.O" + + "utputConfig.BigQueryDestinationH\000\0321\n\016Gcs" + + "Destination\022\037\n\021output_uri_prefix\030\001 \001(\tB\004" + + "\342A\001\002\032h\n\023BigQueryDestination\022\030\n\ndataset_i" + + "d\030\001 \001(\tB\004\342A\001\002\022\035\n\017table_id_prefix\030\002 \001(\tB\004" + + "\342A\001\002\022\030\n\ntable_type\030\003 \001(\tB\004\342A\001\002B\r\n\013destin" + + "ation\"9\n\022ExportErrorsConfig\022\024\n\ngcs_prefi" + + "x\030\001 \001(\tH\000B\r\n\013destination\"\216\001\n\035ExportAnaly" + + "ticsMetricsRequest\022\025\n\007catalog\030\001 \001(\tB\004\342A\001" + + "\002\022F\n\routput_config\030\002 \001(\0132).google.cloud." + + "retail.v2alpha.OutputConfigB\004\342A\001\002\022\016\n\006fil" + + "ter\030\003 \001(\t\"r\n\016ExportMetadata\022/\n\013create_ti" + + "me\030\001 \001(\0132\032.google.protobuf.Timestamp\022/\n\013" + + "update_time\030\002 \001(\0132\032.google.protobuf.Time" + + "stamp\"\315\001\n\026ExportProductsResponse\022)\n\rerro" + + "r_samples\030\001 \003(\0132\022.google.rpc.Status\022F\n\re" + + "rrors_config\030\002 \001(\0132/.google.cloud.retail" + + ".v2alpha.ExportErrorsConfig\022@\n\routput_re" + + "sult\030\003 \001(\0132).google.cloud.retail.v2alpha" + + ".OutputResult\"\317\001\n\030ExportUserEventsRespon" + + "se\022)\n\rerror_samples\030\001 \003(\0132\022.google.rpc.S" + + "tatus\022F\n\rerrors_config\030\002 \001(\0132/.google.cl" + + "oud.retail.v2alpha.ExportErrorsConfig\022@\n" + + "\routput_result\030\003 \001(\0132).google.cloud.reta" + + "il.v2alpha.OutputResult\"\325\001\n\036ExportAnalyt" + + "icsMetricsResponse\022)\n\rerror_samples\030\001 \003(" + + "\0132\022.google.rpc.Status\022F\n\rerrors_config\030\002" + + " \001(\0132/.google.cloud.retail.v2alpha.Expor" + + "tErrorsConfig\022@\n\routput_result\030\003 \001(\0132).g" + + "oogle.cloud.retail.v2alpha.OutputResult\"" + + "\234\001\n\014OutputResult\022J\n\017bigquery_result\030\001 \003(" + + "\01321.google.cloud.retail.v2alpha.BigQuery" + + "OutputResult\022@\n\ngcs_result\030\002 \003(\0132,.googl" + + "e.cloud.retail.v2alpha.GcsOutputResult\"<" + + "\n\024BigQueryOutputResult\022\022\n\ndataset_id\030\001 \001" + + "(\t\022\020\n\010table_id\030\002 \001(\t\"%\n\017GcsOutputResult\022" + + "\022\n\noutput_uri\030\001 \001(\tB\325\001\n\037com.google.cloud" + + ".retail.v2alphaB\021ExportConfigProtoP\001Z7cl" + + "oud.google.com/go/retail/apiv2alpha/reta" + + "ilpb;retailpb\242\002\006RETAIL\252\002\033Google.Cloud.Re" + + "tail.V2Alpha\312\002\033Google\\Cloud\\Retail\\V2alp" + + "ha\352\002\036Google::Cloud::Retail::V2alphab\006pro" + + "to3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -106,16 +145,48 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.TimestampProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), }); - internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_descriptor = + internal_static_google_cloud_retail_v2alpha_OutputConfig_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2alpha_OutputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_OutputConfig_descriptor, + new java.lang.String[] { + "GcsDestination", "BigqueryDestination", "Destination", + }); + internal_static_google_cloud_retail_v2alpha_OutputConfig_GcsDestination_descriptor = + internal_static_google_cloud_retail_v2alpha_OutputConfig_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2alpha_OutputConfig_GcsDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_OutputConfig_GcsDestination_descriptor, + new java.lang.String[] { + "OutputUriPrefix", + }); + internal_static_google_cloud_retail_v2alpha_OutputConfig_BigQueryDestination_descriptor = + internal_static_google_cloud_retail_v2alpha_OutputConfig_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_retail_v2alpha_OutputConfig_BigQueryDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_OutputConfig_BigQueryDestination_descriptor, + new java.lang.String[] { + "DatasetId", "TableIdPrefix", "TableType", + }); + internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_descriptor = + getDescriptor().getMessageTypes().get(1); internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2alpha_ExportErrorsConfig_descriptor, new java.lang.String[] { "GcsPrefix", "Destination", }); + internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsRequest_descriptor, + new java.lang.String[] { + "Catalog", "OutputConfig", "Filter", + }); internal_static_google_cloud_retail_v2alpha_ExportMetadata_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(3); internal_static_google_cloud_retail_v2alpha_ExportMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2alpha_ExportMetadata_descriptor, @@ -123,7 +194,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CreateTime", "UpdateTime", }); internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(4); internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2alpha_ExportProductsResponse_descriptor, @@ -131,15 +202,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ErrorSamples", "ErrorsConfig", "OutputResult", }); internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(5); internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2alpha_ExportUserEventsResponse_descriptor, new java.lang.String[] { "ErrorSamples", "ErrorsConfig", "OutputResult", }); + internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2alpha_ExportAnalyticsMetricsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", "OutputResult", + }); internal_static_google_cloud_retail_v2alpha_OutputResult_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(7); internal_static_google_cloud_retail_v2alpha_OutputResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2alpha_OutputResult_descriptor, @@ -147,7 +226,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "BigqueryResult", "GcsResult", }); internal_static_google_cloud_retail_v2alpha_BigQueryOutputResult_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(8); internal_static_google_cloud_retail_v2alpha_BigQueryOutputResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2alpha_BigQueryOutputResult_descriptor, @@ -155,13 +234,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DatasetId", "TableId", }); internal_static_google_cloud_retail_v2alpha_GcsOutputResult_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(9); internal_static_google_cloud_retail_v2alpha_GcsOutputResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2alpha_GcsOutputResult_descriptor, new java.lang.String[] { "OutputUri", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); diff --git a/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/OutputConfig.java b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/OutputConfig.java new file mode 100644 index 000000000000..bfc0b591abd0 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/OutputConfig.java @@ -0,0 +1,2940 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +/** + * + * + *
+ * The output configuration setting.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.OutputConfig} + */ +public final class OutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.OutputConfig) + OutputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use OutputConfig.newBuilder() to construct. + private OutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OutputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OutputConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.OutputConfig.class, + com.google.cloud.retail.v2alpha.OutputConfig.Builder.class); + } + + public interface GcsDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.OutputConfig.GcsDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The output uri prefix for saving output data to json files.
+     * Some mapping examples are as follows:
+     * output_uri_prefix         sample output(assuming the object is foo.json)
+     * ========================  =============================================
+     * gs://bucket/              gs://bucket/foo.json
+     * gs://bucket/folder/       gs://bucket/folder/foo.json
+     * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUriPrefix. + */ + java.lang.String getOutputUriPrefix(); + /** + * + * + *
+     * Required. The output uri prefix for saving output data to json files.
+     * Some mapping examples are as follows:
+     * output_uri_prefix         sample output(assuming the object is foo.json)
+     * ========================  =============================================
+     * gs://bucket/              gs://bucket/foo.json
+     * gs://bucket/folder/       gs://bucket/folder/foo.json
+     * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUriPrefix. + */ + com.google.protobuf.ByteString getOutputUriPrefixBytes(); + } + /** + * + * + *
+   * The Google Cloud Storage output destination configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.OutputConfig.GcsDestination} + */ + public static final class GcsDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.OutputConfig.GcsDestination) + GcsDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsDestination.newBuilder() to construct. + private GcsDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsDestination() { + outputUriPrefix_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsDestination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.class, + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.Builder.class); + } + + public static final int OUTPUT_URI_PREFIX_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object outputUriPrefix_ = ""; + /** + * + * + *
+     * Required. The output uri prefix for saving output data to json files.
+     * Some mapping examples are as follows:
+     * output_uri_prefix         sample output(assuming the object is foo.json)
+     * ========================  =============================================
+     * gs://bucket/              gs://bucket/foo.json
+     * gs://bucket/folder/       gs://bucket/folder/foo.json
+     * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUriPrefix. + */ + @java.lang.Override + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUriPrefix_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The output uri prefix for saving output data to json files.
+     * Some mapping examples are as follows:
+     * output_uri_prefix         sample output(assuming the object is foo.json)
+     * ========================  =============================================
+     * gs://bucket/              gs://bucket/foo.json
+     * gs://bucket/folder/       gs://bucket/folder/foo.json
+     * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUriPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUriPrefix_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputUriPrefix_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUriPrefix_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputUriPrefix_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination other = + (com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination) obj; + + if (!getOutputUriPrefix().equals(other.getOutputUriPrefix())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OUTPUT_URI_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getOutputUriPrefix().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The Google Cloud Storage output destination configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.OutputConfig.GcsDestination} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.OutputConfig.GcsDestination) + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.class, + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + outputUriPrefix_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_GcsDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination build() { + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination buildPartial() { + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination result = + new com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.outputUriPrefix_ = outputUriPrefix_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination) { + return mergeFrom((com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination other) { + if (other + == com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.getDefaultInstance()) + return this; + if (!other.getOutputUriPrefix().isEmpty()) { + outputUriPrefix_ = other.outputUriPrefix_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + outputUriPrefix_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object outputUriPrefix_ = ""; + /** + * + * + *
+       * Required. The output uri prefix for saving output data to json files.
+       * Some mapping examples are as follows:
+       * output_uri_prefix         sample output(assuming the object is foo.json)
+       * ========================  =============================================
+       * gs://bucket/              gs://bucket/foo.json
+       * gs://bucket/folder/       gs://bucket/folder/foo.json
+       * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+       * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUriPrefix. + */ + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUriPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The output uri prefix for saving output data to json files.
+       * Some mapping examples are as follows:
+       * output_uri_prefix         sample output(assuming the object is foo.json)
+       * ========================  =============================================
+       * gs://bucket/              gs://bucket/foo.json
+       * gs://bucket/folder/       gs://bucket/folder/foo.json
+       * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+       * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUriPrefix. + */ + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The output uri prefix for saving output data to json files.
+       * Some mapping examples are as follows:
+       * output_uri_prefix         sample output(assuming the object is foo.json)
+       * ========================  =============================================
+       * gs://bucket/              gs://bucket/foo.json
+       * gs://bucket/folder/       gs://bucket/folder/foo.json
+       * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+       * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The outputUriPrefix to set. + * @return This builder for chaining. + */ + public Builder setOutputUriPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputUriPrefix_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The output uri prefix for saving output data to json files.
+       * Some mapping examples are as follows:
+       * output_uri_prefix         sample output(assuming the object is foo.json)
+       * ========================  =============================================
+       * gs://bucket/              gs://bucket/foo.json
+       * gs://bucket/folder/       gs://bucket/folder/foo.json
+       * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+       * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearOutputUriPrefix() { + outputUriPrefix_ = getDefaultInstance().getOutputUriPrefix(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The output uri prefix for saving output data to json files.
+       * Some mapping examples are as follows:
+       * output_uri_prefix         sample output(assuming the object is foo.json)
+       * ========================  =============================================
+       * gs://bucket/              gs://bucket/foo.json
+       * gs://bucket/folder/       gs://bucket/folder/foo.json
+       * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+       * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for outputUriPrefix to set. + * @return This builder for chaining. + */ + public Builder setOutputUriPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputUriPrefix_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.OutputConfig.GcsDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.OutputConfig.GcsDestination) + private static final com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination(); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BigQueryDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The ID of a BigQuery Dataset.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + java.lang.String getDatasetId(); + /** + * + * + *
+     * Required. The ID of a BigQuery Dataset.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + com.google.protobuf.ByteString getDatasetIdBytes(); + + /** + * + * + *
+     * Required. The prefix of exported BigQuery tables.
+     * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableIdPrefix. + */ + java.lang.String getTableIdPrefix(); + /** + * + * + *
+     * Required. The prefix of exported BigQuery tables.
+     * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableIdPrefix. + */ + com.google.protobuf.ByteString getTableIdPrefixBytes(); + + /** + * + * + *
+     * Required. Describes the table type. The following values are supported:
+     *
+     * * `table`: A BigQuery native table.
+     * * `view`: A virtual table defined by a SQL query.
+     * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableType. + */ + java.lang.String getTableType(); + /** + * + * + *
+     * Required. Describes the table type. The following values are supported:
+     *
+     * * `table`: A BigQuery native table.
+     * * `view`: A virtual table defined by a SQL query.
+     * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableType. + */ + com.google.protobuf.ByteString getTableTypeBytes(); + } + /** + * + * + *
+   * The BigQuery output destination configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination} + */ + public static final class BigQueryDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) + BigQueryDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use BigQueryDestination.newBuilder() to construct. + private BigQueryDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigQueryDestination() { + datasetId_ = ""; + tableIdPrefix_ = ""; + tableType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BigQueryDestination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_BigQueryDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_BigQueryDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.class, + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.Builder.class); + } + + public static final int DATASET_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object datasetId_ = ""; + /** + * + * + *
+     * Required. The ID of a BigQuery Dataset.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + @java.lang.Override + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The ID of a BigQuery Dataset.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_ID_PREFIX_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableIdPrefix_ = ""; + /** + * + * + *
+     * Required. The prefix of exported BigQuery tables.
+     * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableIdPrefix. + */ + @java.lang.Override + public java.lang.String getTableIdPrefix() { + java.lang.Object ref = tableIdPrefix_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableIdPrefix_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The prefix of exported BigQuery tables.
+     * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableIdPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableIdPrefixBytes() { + java.lang.Object ref = tableIdPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableIdPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_TYPE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableType_ = ""; + /** + * + * + *
+     * Required. Describes the table type. The following values are supported:
+     *
+     * * `table`: A BigQuery native table.
+     * * `view`: A virtual table defined by a SQL query.
+     * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableType. + */ + @java.lang.Override + public java.lang.String getTableType() { + java.lang.Object ref = tableType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableType_ = s; + return s; + } + } + /** + * + * + *
+     * Required. Describes the table type. The following values are supported:
+     *
+     * * `table`: A BigQuery native table.
+     * * `view`: A virtual table defined by a SQL query.
+     * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableTypeBytes() { + java.lang.Object ref = tableType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableIdPrefix_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tableIdPrefix_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, tableType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableIdPrefix_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tableIdPrefix_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, tableType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination other = + (com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) obj; + + if (!getDatasetId().equals(other.getDatasetId())) return false; + if (!getTableIdPrefix().equals(other.getTableIdPrefix())) return false; + if (!getTableType().equals(other.getTableType())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATASET_ID_FIELD_NUMBER; + hash = (53 * hash) + getDatasetId().hashCode(); + hash = (37 * hash) + TABLE_ID_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getTableIdPrefix().hashCode(); + hash = (37 * hash) + TABLE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getTableType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The BigQuery output destination configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_BigQueryDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_BigQueryDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.class, + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + datasetId_ = ""; + tableIdPrefix_ = ""; + tableType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_BigQueryDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination build() { + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination buildPartial() { + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination result = + new com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.datasetId_ = datasetId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tableIdPrefix_ = tableIdPrefix_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.tableType_ = tableType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) { + return mergeFrom( + (com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination other) { + if (other + == com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + .getDefaultInstance()) return this; + if (!other.getDatasetId().isEmpty()) { + datasetId_ = other.datasetId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTableIdPrefix().isEmpty()) { + tableIdPrefix_ = other.tableIdPrefix_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getTableType().isEmpty()) { + tableType_ = other.tableType_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + datasetId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + tableIdPrefix_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + tableType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object datasetId_ = ""; + /** + * + * + *
+       * Required. The ID of a BigQuery Dataset.
+       * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The ID of a BigQuery Dataset.
+       * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The ID of a BigQuery Dataset.
+       * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + datasetId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The ID of a BigQuery Dataset.
+       * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDatasetId() { + datasetId_ = getDefaultInstance().getDatasetId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The ID of a BigQuery Dataset.
+       * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + datasetId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object tableIdPrefix_ = ""; + /** + * + * + *
+       * Required. The prefix of exported BigQuery tables.
+       * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableIdPrefix. + */ + public java.lang.String getTableIdPrefix() { + java.lang.Object ref = tableIdPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableIdPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The prefix of exported BigQuery tables.
+       * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableIdPrefix. + */ + public com.google.protobuf.ByteString getTableIdPrefixBytes() { + java.lang.Object ref = tableIdPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableIdPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The prefix of exported BigQuery tables.
+       * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The tableIdPrefix to set. + * @return This builder for chaining. + */ + public Builder setTableIdPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableIdPrefix_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The prefix of exported BigQuery tables.
+       * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTableIdPrefix() { + tableIdPrefix_ = getDefaultInstance().getTableIdPrefix(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The prefix of exported BigQuery tables.
+       * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for tableIdPrefix to set. + * @return This builder for chaining. + */ + public Builder setTableIdPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableIdPrefix_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object tableType_ = ""; + /** + * + * + *
+       * Required. Describes the table type. The following values are supported:
+       *
+       * * `table`: A BigQuery native table.
+       * * `view`: A virtual table defined by a SQL query.
+       * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableType. + */ + public java.lang.String getTableType() { + java.lang.Object ref = tableType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. Describes the table type. The following values are supported:
+       *
+       * * `table`: A BigQuery native table.
+       * * `view`: A virtual table defined by a SQL query.
+       * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableType. + */ + public com.google.protobuf.ByteString getTableTypeBytes() { + java.lang.Object ref = tableType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. Describes the table type. The following values are supported:
+       *
+       * * `table`: A BigQuery native table.
+       * * `view`: A virtual table defined by a SQL query.
+       * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The tableType to set. + * @return This builder for chaining. + */ + public Builder setTableType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Describes the table type. The following values are supported:
+       *
+       * * `table`: A BigQuery native table.
+       * * `view`: A virtual table defined by a SQL query.
+       * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTableType() { + tableType_ = getDefaultInstance().getTableType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Describes the table type. The following values are supported:
+       *
+       * * `table`: A BigQuery native table.
+       * * `view`: A virtual table defined by a SQL query.
+       * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for tableType to set. + * @return This builder for chaining. + */ + public Builder setTableTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) + private static final com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination(); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigQueryDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int destinationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_DESTINATION(1), + BIGQUERY_DESTINATION(2), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_DESTINATION; + case 2: + return BIGQUERY_DESTINATION; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination getGcsDestination() { + if (destinationCase_ == 1) { + return (com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination) destination_; + } + return com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.getDefaultInstance(); + } + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.GcsDestinationOrBuilder + getGcsDestinationOrBuilder() { + if (destinationCase_ == 1) { + return (com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination) destination_; + } + return com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.getDefaultInstance(); + } + + public static final int BIGQUERY_DESTINATION_FIELD_NUMBER = 2; + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return Whether the bigqueryDestination field is set. + */ + @java.lang.Override + public boolean hasBigqueryDestination() { + return destinationCase_ == 2; + } + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return The bigqueryDestination. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination getBigqueryDestination() { + if (destinationCase_ == 2) { + return (com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) destination_; + } + return com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.getDefaultInstance(); + } + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestinationOrBuilder + getBigqueryDestinationOrBuilder() { + if (destinationCase_ == 2) { + return (com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) destination_; + } + return com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (destinationCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination) destination_); + } + if (destinationCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) destination_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination) destination_); + } + if (destinationCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) destination_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2alpha.OutputConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2alpha.OutputConfig other = + (com.google.cloud.retail.v2alpha.OutputConfig) obj; + + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsDestination().equals(other.getGcsDestination())) return false; + break; + case 2: + if (!getBigqueryDestination().equals(other.getBigqueryDestination())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getGcsDestination().hashCode(); + break; + case 2: + hash = (37 * hash) + BIGQUERY_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getBigqueryDestination().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2alpha.OutputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The output configuration setting.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2alpha.OutputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2alpha.OutputConfig) + com.google.cloud.retail.v2alpha.OutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2alpha.OutputConfig.class, + com.google.cloud.retail.v2alpha.OutputConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2alpha.OutputConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (gcsDestinationBuilder_ != null) { + gcsDestinationBuilder_.clear(); + } + if (bigqueryDestinationBuilder_ != null) { + bigqueryDestinationBuilder_.clear(); + } + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2alpha.ExportConfigProto + .internal_static_google_cloud_retail_v2alpha_OutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2alpha.OutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig build() { + com.google.cloud.retail.v2alpha.OutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig buildPartial() { + com.google.cloud.retail.v2alpha.OutputConfig result = + new com.google.cloud.retail.v2alpha.OutputConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.retail.v2alpha.OutputConfig result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.retail.v2alpha.OutputConfig result) { + result.destinationCase_ = destinationCase_; + result.destination_ = this.destination_; + if (destinationCase_ == 1 && gcsDestinationBuilder_ != null) { + result.destination_ = gcsDestinationBuilder_.build(); + } + if (destinationCase_ == 2 && bigqueryDestinationBuilder_ != null) { + result.destination_ = bigqueryDestinationBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2alpha.OutputConfig) { + return mergeFrom((com.google.cloud.retail.v2alpha.OutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2alpha.OutputConfig other) { + if (other == com.google.cloud.retail.v2alpha.OutputConfig.getDefaultInstance()) return this; + switch (other.getDestinationCase()) { + case GCS_DESTINATION: + { + mergeGcsDestination(other.getGcsDestination()); + break; + } + case BIGQUERY_DESTINATION: + { + mergeBigqueryDestination(other.getBigqueryDestination()); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGcsDestinationFieldBuilder().getBuilder(), extensionRegistry); + destinationCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + getBigqueryDestinationFieldBuilder().getBuilder(), extensionRegistry); + destinationCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination, + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.Builder, + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestinationOrBuilder> + gcsDestinationBuilder_; + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + return (com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination) destination_; + } + return com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 1) { + return gcsDestinationBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination( + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination( + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + */ + public Builder mergeGcsDestination( + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1 + && destination_ + != com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination + .getDefaultInstance()) { + destination_ = + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.newBuilder( + (com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination) destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 1) { + gcsDestinationBuilder_.mergeFrom(value); + } else { + gcsDestinationBuilder_.setMessage(value); + } + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + */ + public Builder clearGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + } + gcsDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.Builder + getGcsDestinationBuilder() { + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.GcsDestinationOrBuilder + getGcsDestinationOrBuilder() { + if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 1) { + return (com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination) destination_; + } + return com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination, + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.Builder, + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + if (!(destinationCase_ == 1)) { + destination_ = + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.getDefaultInstance(); + } + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination, + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination.Builder, + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestinationOrBuilder>( + (com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 1; + onChanged(); + return gcsDestinationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination, + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.Builder, + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestinationOrBuilder> + bigqueryDestinationBuilder_; + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return Whether the bigqueryDestination field is set. + */ + @java.lang.Override + public boolean hasBigqueryDestination() { + return destinationCase_ == 2; + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return The bigqueryDestination. + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + getBigqueryDestination() { + if (bigqueryDestinationBuilder_ == null) { + if (destinationCase_ == 2) { + return (com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) destination_; + } + return com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + .getDefaultInstance(); + } else { + if (destinationCase_ == 2) { + return bigqueryDestinationBuilder_.getMessage(); + } + return com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + public Builder setBigqueryDestination( + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination value) { + if (bigqueryDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + bigqueryDestinationBuilder_.setMessage(value); + } + destinationCase_ = 2; + return this; + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + public Builder setBigqueryDestination( + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.Builder builderForValue) { + if (bigqueryDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + bigqueryDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 2; + return this; + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + public Builder mergeBigqueryDestination( + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination value) { + if (bigqueryDestinationBuilder_ == null) { + if (destinationCase_ == 2 + && destination_ + != com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + .getDefaultInstance()) { + destination_ = + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.newBuilder( + (com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) + destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 2) { + bigqueryDestinationBuilder_.mergeFrom(value); + } else { + bigqueryDestinationBuilder_.setMessage(value); + } + } + destinationCase_ = 2; + return this; + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + public Builder clearBigqueryDestination() { + if (bigqueryDestinationBuilder_ == null) { + if (destinationCase_ == 2) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 2) { + destinationCase_ = 0; + destination_ = null; + } + bigqueryDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + public com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.Builder + getBigqueryDestinationBuilder() { + return getBigqueryDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestinationOrBuilder + getBigqueryDestinationOrBuilder() { + if ((destinationCase_ == 2) && (bigqueryDestinationBuilder_ != null)) { + return bigqueryDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 2) { + return (com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) destination_; + } + return com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination + .getDefaultInstance(); + } + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination, + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.Builder, + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestinationOrBuilder> + getBigqueryDestinationFieldBuilder() { + if (bigqueryDestinationBuilder_ == null) { + if (!(destinationCase_ == 2)) { + destination_ = + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.getDefaultInstance(); + } + bigqueryDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination, + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination.Builder, + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestinationOrBuilder>( + (com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 2; + onChanged(); + return bigqueryDestinationBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2alpha.OutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2alpha.OutputConfig) + private static final com.google.cloud.retail.v2alpha.OutputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2alpha.OutputConfig(); + } + + public static com.google.cloud.retail.v2alpha.OutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2alpha.OutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/OutputConfigOrBuilder.java b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/OutputConfigOrBuilder.java new file mode 100644 index 000000000000..8725abee206d --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2alpha/src/main/java/com/google/cloud/retail/v2alpha/OutputConfigOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2alpha/export_config.proto + +package com.google.cloud.retail.v2alpha; + +public interface OutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2alpha.OutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + boolean hasGcsDestination(); + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestination getGcsDestination(); + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.GcsDestination gcs_destination = 1; + */ + com.google.cloud.retail.v2alpha.OutputConfig.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return Whether the bigqueryDestination field is set. + */ + boolean hasBigqueryDestination(); + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return The bigqueryDestination. + */ + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination getBigqueryDestination(); + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2alpha.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + com.google.cloud.retail.v2alpha.OutputConfig.BigQueryDestinationOrBuilder + getBigqueryDestinationOrBuilder(); + + com.google.cloud.retail.v2alpha.OutputConfig.DestinationCase getDestinationCase(); +} diff --git a/java-retail/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/analytics_service.proto b/java-retail/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/analytics_service.proto new file mode 100644 index 000000000000..84df2cf9befd --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/analytics_service.proto @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2alpha/export_config.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Alpha"; +option go_package = "cloud.google.com/go/retail/apiv2alpha/retailpb;retailpb"; +option java_multiple_files = true; +option java_outer_classname = "AnalyticsServiceProto"; +option java_package = "com.google.cloud.retail.v2alpha"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; +option ruby_package = "Google::Cloud::Retail::V2alpha"; + +// Service for managing & accessing retail search business metric. +// Retail recommendation business metric is currently not available. +service AnalyticsService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Exports analytics metrics. + // + // `Operation.response` is of type `ExportAnalyticsMetricsResponse`. + // `Operation.metadata` is of type `ExportMetadata`. + rpc ExportAnalyticsMetrics(ExportAnalyticsMetricsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2alpha/{catalog=projects/*/locations/*/catalogs/*}:exportAnalyticsMetrics" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse" + metadata_type: "google.cloud.retail.v2alpha.ExportMetadata" + }; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/export_config.proto b/java-retail/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/export_config.proto index 40ceb9cdb3bc..83d4acfc842e 100644 --- a/java-retail/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/export_config.proto +++ b/java-retail/proto-google-cloud-retail-v2alpha/src/main/proto/google/cloud/retail/v2alpha/export_config.proto @@ -30,6 +30,45 @@ option objc_class_prefix = "RETAIL"; option php_namespace = "Google\\Cloud\\Retail\\V2alpha"; option ruby_package = "Google::Cloud::Retail::V2alpha"; +// The output configuration setting. +message OutputConfig { + // The Google Cloud Storage output destination configuration. + message GcsDestination { + // Required. The output uri prefix for saving output data to json files. + // Some mapping examples are as follows: + // output_uri_prefix sample output(assuming the object is foo.json) + // ======================== ============================================= + // gs://bucket/ gs://bucket/foo.json + // gs://bucket/folder/ gs://bucket/folder/foo.json + // gs://bucket/folder/item_ gs://bucket/folder/item_foo.json + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The BigQuery output destination configuration. + message BigQueryDestination { + // Required. The ID of a BigQuery Dataset. + string dataset_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The prefix of exported BigQuery tables. + string table_id_prefix = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Describes the table type. The following values are supported: + // + // * `table`: A BigQuery native table. + // * `view`: A virtual table defined by a SQL query. + string table_type = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // The configuration of destination for holding output data. + oneof destination { + // The Google Cloud Storage location where the output is to be written to. + GcsDestination gcs_destination = 1; + + // The BigQuery location where the output is to be written to. + BigQueryDestination bigquery_destination = 2; + } +} + // Configuration of destination for Export related errors. message ExportErrorsConfig { // Required. Errors destination. @@ -42,6 +81,35 @@ message ExportErrorsConfig { } } +// Request message for the `ExportAnalyticsMetrics` method. +message ExportAnalyticsMetricsRequest { + // Required. Full resource name of the parent catalog. + // Expected format: `projects/*/locations/*/catalogs/*` + string catalog = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The output location of the data. + OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // A filtering expression to specify restrictions on returned metrics. + // The expression is a sequence of terms. Each term applies a restriction to + // the returned metrics. Use this expression to restrict results to a + // specific time range. + // + // Currently we expect only one types of fields: + // + // * `timestamp`: This can be specified twice, once with a + // less than operator and once with a greater than operator. The + // `timestamp` restriction should result in one, contiguous, valid, + // `timestamp` range. + // + // Some examples of valid filters expressions: + // + // * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" + // timestamp < "2012-04-23T18:30:43.511Z"` + // * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` + string filter = 3; +} + // Metadata related to the progress of the Export operation. This is // returned by the google.longrunning.Operation.metadata field. message ExportMetadata { @@ -81,6 +149,20 @@ message ExportUserEventsResponse { OutputResult output_result = 3; } +// Response of the ExportAnalyticsMetricsRequest. If the long running +// operation was successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ExportAnalyticsMetricsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // This field is never set. + ExportErrorsConfig errors_config = 2; + + // Output result indicating where the data were exported to. + OutputResult output_result = 3; +} + // Output result that stores the information about where the exported data is // stored. message OutputResult { diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceProto.java new file mode 100644 index 000000000000..0e7d42f3b80c --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AnalyticsServiceProto.java @@ -0,0 +1,90 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2beta/analytics_service.proto + +package com.google.cloud.retail.v2beta; + +public final class AnalyticsServiceProto { + private AnalyticsServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n2google/cloud/retail/v2beta/analytics_s" + + "ervice.proto\022\032google.cloud.retail.v2beta" + + "\032\034google/api/annotations.proto\032\027google/a" + + "pi/client.proto\032\037google/api/field_behavi" + + "or.proto\032\031google/api/resource.proto\032.goo" + + "gle/cloud/retail/v2beta/export_config.pr" + + "oto\032#google/longrunning/operations.proto" + + "2\223\003\n\020AnalyticsService\022\263\002\n\026ExportAnalytic" + + "sMetrics\0229.google.cloud.retail.v2beta.Ex" + + "portAnalyticsMetricsRequest\032\035.google.lon" + + "grunning.Operation\"\276\001\312Af\n9google.cloud.r" + + "etail.v2beta.ExportAnalyticsMetricsRespo" + + "nse\022)google.cloud.retail.v2beta.ExportMe" + + "tadata\202\323\344\223\002O\"J/v2beta/{catalog=projects/" + + "*/locations/*/catalogs/*}:exportAnalytic" + + "sMetrics:\001*\032I\312A\025retail.googleapis.com\322A." + + "https://www.googleapis.com/auth/cloud-pl" + + "atformB\324\001\n\036com.google.cloud.retail.v2bet" + + "aB\025AnalyticsServiceProtoP\001Z6cloud.google" + + ".com/go/retail/apiv2beta/retailpb;retail" + + "pb\242\002\006RETAIL\252\002\032Google.Cloud.Retail.V2Beta" + + "\312\002\032Google\\Cloud\\Retail\\V2beta\352\002\035Google::" + + "Cloud::Retail::V2betab\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2beta.ExportConfigProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.retail.v2beta.ExportConfigProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsRequest.java new file mode 100644 index 000000000000..00de1993a0a3 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsRequest.java @@ -0,0 +1,1220 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2beta/export_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request message for the `ExportAnalyticsMetrics` method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest} + */ +public final class ExportAnalyticsMetricsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest) + ExportAnalyticsMetricsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportAnalyticsMetricsRequest.newBuilder() to construct. + private ExportAnalyticsMetricsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportAnalyticsMetricsRequest() { + catalog_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportAnalyticsMetricsRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest.class, + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest.Builder.class); + } + + public static final int CATALOG_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object catalog_ = ""; + /** + * + * + *
+   * Required. Full resource name of the parent catalog.
+   * Expected format: `projects/*/locations/*/catalogs/*`
+   * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The catalog. + */ + @java.lang.Override + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Full resource name of the parent catalog.
+   * Expected format: `projects/*/locations/*/catalogs/*`
+   * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for catalog. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.OutputConfig outputConfig_; + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.retail.v2beta.OutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return outputConfig_ == null + ? com.google.cloud.retail.v2beta.OutputConfig.getDefaultInstance() + : outputConfig_; + } + + public static final int FILTER_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * A filtering expression to specify restrictions on returned metrics.
+   * The expression is a sequence of terms. Each term applies a restriction to
+   * the returned metrics. Use this expression to restrict results to a
+   * specific time range.
+   *
+   *   Currently we expect only one types of fields:
+   *
+   *    * `timestamp`: This can be specified twice, once with a
+   *      less than operator and once with a greater than operator. The
+   *      `timestamp` restriction should result in one, contiguous, valid,
+   *      `timestamp` range.
+   *
+   *   Some examples of valid filters expressions:
+   *
+   *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+   *             timestamp < "2012-04-23T18:30:43.511Z"`
+   *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+   * 
+ * + * string filter = 3; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * A filtering expression to specify restrictions on returned metrics.
+   * The expression is a sequence of terms. Each term applies a restriction to
+   * the returned metrics. Use this expression to restrict results to a
+   * specific time range.
+   *
+   *   Currently we expect only one types of fields:
+   *
+   *    * `timestamp`: This can be specified twice, once with a
+   *      less than operator and once with a greater than operator. The
+   *      `timestamp` restriction should result in one, contiguous, valid,
+   *      `timestamp` range.
+   *
+   *   Some examples of valid filters expressions:
+   *
+   *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+   *             timestamp < "2012-04-23T18:30:43.511Z"`
+   *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+   * 
+ * + * string filter = 3; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(catalog_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, catalog_); + } + if (outputConfig_ != null) { + output.writeMessage(2, getOutputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, filter_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(catalog_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, catalog_); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOutputConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, filter_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest other = + (com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest) obj; + + if (!getCatalog().equals(other.getCatalog())) return false; + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig().equals(other.getOutputConfig())) return false; + } + if (!getFilter().equals(other.getFilter())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CATALOG_FIELD_NUMBER; + hash = (53 * hash) + getCatalog().hashCode(); + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for the `ExportAnalyticsMetrics` method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest) + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest.class, + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + catalog_ = ""; + outputConfig_ = null; + if (outputConfigBuilder_ != null) { + outputConfigBuilder_.dispose(); + outputConfigBuilder_ = null; + } + filter_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest build() { + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest buildPartial() { + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest result = + new com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.catalog_ = catalog_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.outputConfig_ = + outputConfigBuilder_ == null ? outputConfig_ : outputConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.filter_ = filter_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest other) { + if (other + == com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest.getDefaultInstance()) + return this; + if (!other.getCatalog().isEmpty()) { + catalog_ = other.catalog_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + catalog_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getOutputConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object catalog_ = ""; + /** + * + * + *
+     * Required. Full resource name of the parent catalog.
+     * Expected format: `projects/*/locations/*/catalogs/*`
+     * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The catalog. + */ + public java.lang.String getCatalog() { + java.lang.Object ref = catalog_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + catalog_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of the parent catalog.
+     * Expected format: `projects/*/locations/*/catalogs/*`
+     * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for catalog. + */ + public com.google.protobuf.ByteString getCatalogBytes() { + java.lang.Object ref = catalog_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + catalog_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Full resource name of the parent catalog.
+     * Expected format: `projects/*/locations/*/catalogs/*`
+     * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalog(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + catalog_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the parent catalog.
+     * Expected format: `projects/*/locations/*/catalogs/*`
+     * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearCatalog() { + catalog_ = getDefaultInstance().getCatalog(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Full resource name of the parent catalog.
+     * Expected format: `projects/*/locations/*/catalogs/*`
+     * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for catalog to set. + * @return This builder for chaining. + */ + public Builder setCatalogBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + catalog_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.OutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputConfig, + com.google.cloud.retail.v2beta.OutputConfig.Builder, + com.google.cloud.retail.v2beta.OutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + public com.google.cloud.retail.v2beta.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.retail.v2beta.OutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig(com.google.cloud.retail.v2beta.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + } else { + outputConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig( + com.google.cloud.retail.v2beta.OutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeOutputConfig(com.google.cloud.retail.v2beta.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && outputConfig_ != null + && outputConfig_ != com.google.cloud.retail.v2beta.OutputConfig.getDefaultInstance()) { + getOutputConfigBuilder().mergeFrom(value); + } else { + outputConfig_ = value; + } + } else { + outputConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearOutputConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + outputConfig_ = null; + if (outputConfigBuilder_ != null) { + outputConfigBuilder_.dispose(); + outputConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.OutputConfig.Builder getOutputConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.retail.v2beta.OutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Required. The output location of the data.
+     * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputConfig, + com.google.cloud.retail.v2beta.OutputConfig.Builder, + com.google.cloud.retail.v2beta.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputConfig, + com.google.cloud.retail.v2beta.OutputConfig.Builder, + com.google.cloud.retail.v2beta.OutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * A filtering expression to specify restrictions on returned metrics.
+     * The expression is a sequence of terms. Each term applies a restriction to
+     * the returned metrics. Use this expression to restrict results to a
+     * specific time range.
+     *
+     *   Currently we expect only one types of fields:
+     *
+     *    * `timestamp`: This can be specified twice, once with a
+     *      less than operator and once with a greater than operator. The
+     *      `timestamp` restriction should result in one, contiguous, valid,
+     *      `timestamp` range.
+     *
+     *   Some examples of valid filters expressions:
+     *
+     *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+     *             timestamp < "2012-04-23T18:30:43.511Z"`
+     *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+     * 
+ * + * string filter = 3; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A filtering expression to specify restrictions on returned metrics.
+     * The expression is a sequence of terms. Each term applies a restriction to
+     * the returned metrics. Use this expression to restrict results to a
+     * specific time range.
+     *
+     *   Currently we expect only one types of fields:
+     *
+     *    * `timestamp`: This can be specified twice, once with a
+     *      less than operator and once with a greater than operator. The
+     *      `timestamp` restriction should result in one, contiguous, valid,
+     *      `timestamp` range.
+     *
+     *   Some examples of valid filters expressions:
+     *
+     *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+     *             timestamp < "2012-04-23T18:30:43.511Z"`
+     *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+     * 
+ * + * string filter = 3; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A filtering expression to specify restrictions on returned metrics.
+     * The expression is a sequence of terms. Each term applies a restriction to
+     * the returned metrics. Use this expression to restrict results to a
+     * specific time range.
+     *
+     *   Currently we expect only one types of fields:
+     *
+     *    * `timestamp`: This can be specified twice, once with a
+     *      less than operator and once with a greater than operator. The
+     *      `timestamp` restriction should result in one, contiguous, valid,
+     *      `timestamp` range.
+     *
+     *   Some examples of valid filters expressions:
+     *
+     *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+     *             timestamp < "2012-04-23T18:30:43.511Z"`
+     *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+     * 
+ * + * string filter = 3; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * A filtering expression to specify restrictions on returned metrics.
+     * The expression is a sequence of terms. Each term applies a restriction to
+     * the returned metrics. Use this expression to restrict results to a
+     * specific time range.
+     *
+     *   Currently we expect only one types of fields:
+     *
+     *    * `timestamp`: This can be specified twice, once with a
+     *      less than operator and once with a greater than operator. The
+     *      `timestamp` restriction should result in one, contiguous, valid,
+     *      `timestamp` range.
+     *
+     *   Some examples of valid filters expressions:
+     *
+     *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+     *             timestamp < "2012-04-23T18:30:43.511Z"`
+     *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+     * 
+ * + * string filter = 3; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * A filtering expression to specify restrictions on returned metrics.
+     * The expression is a sequence of terms. Each term applies a restriction to
+     * the returned metrics. Use this expression to restrict results to a
+     * specific time range.
+     *
+     *   Currently we expect only one types of fields:
+     *
+     *    * `timestamp`: This can be specified twice, once with a
+     *      less than operator and once with a greater than operator. The
+     *      `timestamp` restriction should result in one, contiguous, valid,
+     *      `timestamp` range.
+     *
+     *   Some examples of valid filters expressions:
+     *
+     *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+     *             timestamp < "2012-04-23T18:30:43.511Z"`
+     *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+     * 
+ * + * string filter = 3; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest) + private static final com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest(); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportAnalyticsMetricsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsRequestOrBuilder.java new file mode 100644 index 000000000000..67cba9ce0dc5 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsRequestOrBuilder.java @@ -0,0 +1,150 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2beta/export_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ExportAnalyticsMetricsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Full resource name of the parent catalog.
+   * Expected format: `projects/*/locations/*/catalogs/*`
+   * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The catalog. + */ + java.lang.String getCatalog(); + /** + * + * + *
+   * Required. Full resource name of the parent catalog.
+   * Expected format: `projects/*/locations/*/catalogs/*`
+   * 
+ * + * string catalog = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for catalog. + */ + com.google.protobuf.ByteString getCatalogBytes(); + + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + com.google.cloud.retail.v2beta.OutputConfig getOutputConfig(); + /** + * + * + *
+   * Required. The output location of the data.
+   * 
+ * + * + * .google.cloud.retail.v2beta.OutputConfig output_config = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.OutputConfigOrBuilder getOutputConfigOrBuilder(); + + /** + * + * + *
+   * A filtering expression to specify restrictions on returned metrics.
+   * The expression is a sequence of terms. Each term applies a restriction to
+   * the returned metrics. Use this expression to restrict results to a
+   * specific time range.
+   *
+   *   Currently we expect only one types of fields:
+   *
+   *    * `timestamp`: This can be specified twice, once with a
+   *      less than operator and once with a greater than operator. The
+   *      `timestamp` restriction should result in one, contiguous, valid,
+   *      `timestamp` range.
+   *
+   *   Some examples of valid filters expressions:
+   *
+   *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+   *             timestamp < "2012-04-23T18:30:43.511Z"`
+   *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+   * 
+ * + * string filter = 3; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * A filtering expression to specify restrictions on returned metrics.
+   * The expression is a sequence of terms. Each term applies a restriction to
+   * the returned metrics. Use this expression to restrict results to a
+   * specific time range.
+   *
+   *   Currently we expect only one types of fields:
+   *
+   *    * `timestamp`: This can be specified twice, once with a
+   *      less than operator and once with a greater than operator. The
+   *      `timestamp` restriction should result in one, contiguous, valid,
+   *      `timestamp` range.
+   *
+   *   Some examples of valid filters expressions:
+   *
+   *   * Example 1: `timestamp > "2012-04-23T18:25:43.511Z"
+   *             timestamp < "2012-04-23T18:30:43.511Z"`
+   *   * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"`
+   * 
+ * + * string filter = 3; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsResponse.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsResponse.java new file mode 100644 index 000000000000..abd36834d116 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsResponse.java @@ -0,0 +1,1465 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2beta/export_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the ExportAnalyticsMetricsRequest. If the long running
+ * operation was successful, then this message is returned by the
+ * google.longrunning.Operations.response field if the operation was successful.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse} + */ +public final class ExportAnalyticsMetricsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse) + ExportAnalyticsMetricsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportAnalyticsMetricsResponse.newBuilder() to construct. + private ExportAnalyticsMetricsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportAnalyticsMetricsResponse() { + errorSamples_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportAnalyticsMetricsResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse.class, + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse.Builder.class); + } + + public static final int ERROR_SAMPLES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List errorSamples_; + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public java.util.List getErrorSamplesOrBuilderList() { + return errorSamples_; + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public int getErrorSamplesCount() { + return errorSamples_.size(); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.Status getErrorSamples(int index) { + return errorSamples_.get(index); + } + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + return errorSamples_.get(index); + } + + public static final int ERRORS_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.ExportErrorsConfig errorsConfig_; + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + @java.lang.Override + public boolean hasErrorsConfig() { + return errorsConfig_ != null; + } + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportErrorsConfig getErrorsConfig() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + + public static final int OUTPUT_RESULT_FIELD_NUMBER = 3; + private com.google.cloud.retail.v2beta.OutputResult outputResult_; + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + * + * @return Whether the outputResult field is set. + */ + @java.lang.Override + public boolean hasOutputResult() { + return outputResult_ != null; + } + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + * + * @return The outputResult. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputResult getOutputResult() { + return outputResult_ == null + ? com.google.cloud.retail.v2beta.OutputResult.getDefaultInstance() + : outputResult_; + } + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputResultOrBuilder getOutputResultOrBuilder() { + return outputResult_ == null + ? com.google.cloud.retail.v2beta.OutputResult.getDefaultInstance() + : outputResult_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < errorSamples_.size(); i++) { + output.writeMessage(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + output.writeMessage(2, getErrorsConfig()); + } + if (outputResult_ != null) { + output.writeMessage(3, getOutputResult()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < errorSamples_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, errorSamples_.get(i)); + } + if (errorsConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getErrorsConfig()); + } + if (outputResult_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getOutputResult()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse other = + (com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse) obj; + + if (!getErrorSamplesList().equals(other.getErrorSamplesList())) return false; + if (hasErrorsConfig() != other.hasErrorsConfig()) return false; + if (hasErrorsConfig()) { + if (!getErrorsConfig().equals(other.getErrorsConfig())) return false; + } + if (hasOutputResult() != other.hasOutputResult()) return false; + if (hasOutputResult()) { + if (!getOutputResult().equals(other.getOutputResult())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getErrorSamplesCount() > 0) { + hash = (37 * hash) + ERROR_SAMPLES_FIELD_NUMBER; + hash = (53 * hash) + getErrorSamplesList().hashCode(); + } + if (hasErrorsConfig()) { + hash = (37 * hash) + ERRORS_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getErrorsConfig().hashCode(); + } + if (hasOutputResult()) { + hash = (37 * hash) + OUTPUT_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getOutputResult().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response of the ExportAnalyticsMetricsRequest. If the long running
+   * operation was successful, then this message is returned by the
+   * google.longrunning.Operations.response field if the operation was successful.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse) + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse.class, + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + } else { + errorSamples_ = null; + errorSamplesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + errorsConfig_ = null; + if (errorsConfigBuilder_ != null) { + errorsConfigBuilder_.dispose(); + errorsConfigBuilder_ = null; + } + outputResult_ = null; + if (outputResultBuilder_ != null) { + outputResultBuilder_.dispose(); + outputResultBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse build() { + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse buildPartial() { + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse result = + new com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse result) { + if (errorSamplesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = java.util.Collections.unmodifiableList(errorSamples_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.errorSamples_ = errorSamples_; + } else { + result.errorSamples_ = errorSamplesBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.errorsConfig_ = + errorsConfigBuilder_ == null ? errorsConfig_ : errorsConfigBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.outputResult_ = + outputResultBuilder_ == null ? outputResult_ : outputResultBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse other) { + if (other + == com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse.getDefaultInstance()) + return this; + if (errorSamplesBuilder_ == null) { + if (!other.errorSamples_.isEmpty()) { + if (errorSamples_.isEmpty()) { + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureErrorSamplesIsMutable(); + errorSamples_.addAll(other.errorSamples_); + } + onChanged(); + } + } else { + if (!other.errorSamples_.isEmpty()) { + if (errorSamplesBuilder_.isEmpty()) { + errorSamplesBuilder_.dispose(); + errorSamplesBuilder_ = null; + errorSamples_ = other.errorSamples_; + bitField0_ = (bitField0_ & ~0x00000001); + errorSamplesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getErrorSamplesFieldBuilder() + : null; + } else { + errorSamplesBuilder_.addAllMessages(other.errorSamples_); + } + } + } + if (other.hasErrorsConfig()) { + mergeErrorsConfig(other.getErrorsConfig()); + } + if (other.hasOutputResult()) { + mergeOutputResult(other.getOutputResult()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.rpc.Status m = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(m); + } else { + errorSamplesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + input.readMessage(getErrorsConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getOutputResultFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List errorSamples_ = java.util.Collections.emptyList(); + + private void ensureErrorSamplesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + errorSamples_ = new java.util.ArrayList(errorSamples_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + errorSamplesBuilder_; + + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesList() { + if (errorSamplesBuilder_ == null) { + return java.util.Collections.unmodifiableList(errorSamples_); + } else { + return errorSamplesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public int getErrorSamplesCount() { + if (errorSamplesBuilder_ == null) { + return errorSamples_.size(); + } else { + return errorSamplesBuilder_.getCount(); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status getErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, value); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder setErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.set(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status value) { + if (errorSamplesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, value); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addErrorSamples(int index, com.google.rpc.Status.Builder builderForValue) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.add(index, builderForValue.build()); + onChanged(); + } else { + errorSamplesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder addAllErrorSamples(java.lang.Iterable values) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, errorSamples_); + onChanged(); + } else { + errorSamplesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder clearErrorSamples() { + if (errorSamplesBuilder_ == null) { + errorSamples_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + errorSamplesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public Builder removeErrorSamples(int index) { + if (errorSamplesBuilder_ == null) { + ensureErrorSamplesIsMutable(); + errorSamples_.remove(index); + onChanged(); + } else { + errorSamplesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder getErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index) { + if (errorSamplesBuilder_ == null) { + return errorSamples_.get(index); + } else { + return errorSamplesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesOrBuilderList() { + if (errorSamplesBuilder_ != null) { + return errorSamplesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errorSamples_); + } + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder() { + return getErrorSamplesFieldBuilder().addBuilder(com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public com.google.rpc.Status.Builder addErrorSamplesBuilder(int index) { + return getErrorSamplesFieldBuilder() + .addBuilder(index, com.google.rpc.Status.getDefaultInstance()); + } + /** + * + * + *
+     * A sample of errors encountered while processing the request.
+     * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + public java.util.List getErrorSamplesBuilderList() { + return getErrorSamplesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorSamplesFieldBuilder() { + if (errorSamplesBuilder_ == null) { + errorSamplesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + errorSamples_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + errorSamples_ = null; + } + return errorSamplesBuilder_; + } + + private com.google.cloud.retail.v2beta.ExportErrorsConfig errorsConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ExportErrorsConfig, + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder> + errorsConfigBuilder_; + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + public boolean hasErrorsConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + public com.google.cloud.retail.v2beta.ExportErrorsConfig getErrorsConfig() { + if (errorsConfigBuilder_ == null) { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } else { + return errorsConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig(com.google.cloud.retail.v2beta.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorsConfig_ = value; + } else { + errorsConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder setErrorsConfig( + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder builderForValue) { + if (errorsConfigBuilder_ == null) { + errorsConfig_ = builderForValue.build(); + } else { + errorsConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder mergeErrorsConfig(com.google.cloud.retail.v2beta.ExportErrorsConfig value) { + if (errorsConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && errorsConfig_ != null + && errorsConfig_ + != com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance()) { + getErrorsConfigBuilder().mergeFrom(value); + } else { + errorsConfig_ = value; + } + } else { + errorsConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public Builder clearErrorsConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + errorsConfig_ = null; + if (errorsConfigBuilder_ != null) { + errorsConfigBuilder_.dispose(); + errorsConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder getErrorsConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getErrorsConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + public com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder() { + if (errorsConfigBuilder_ != null) { + return errorsConfigBuilder_.getMessageOrBuilder(); + } else { + return errorsConfig_ == null + ? com.google.cloud.retail.v2beta.ExportErrorsConfig.getDefaultInstance() + : errorsConfig_; + } + } + /** + * + * + *
+     * This field is never set.
+     * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ExportErrorsConfig, + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder> + getErrorsConfigFieldBuilder() { + if (errorsConfigBuilder_ == null) { + errorsConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.ExportErrorsConfig, + com.google.cloud.retail.v2beta.ExportErrorsConfig.Builder, + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder>( + getErrorsConfig(), getParentForChildren(), isClean()); + errorsConfig_ = null; + } + return errorsConfigBuilder_; + } + + private com.google.cloud.retail.v2beta.OutputResult outputResult_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputResult, + com.google.cloud.retail.v2beta.OutputResult.Builder, + com.google.cloud.retail.v2beta.OutputResultOrBuilder> + outputResultBuilder_; + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + * + * @return Whether the outputResult field is set. + */ + public boolean hasOutputResult() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + * + * @return The outputResult. + */ + public com.google.cloud.retail.v2beta.OutputResult getOutputResult() { + if (outputResultBuilder_ == null) { + return outputResult_ == null + ? com.google.cloud.retail.v2beta.OutputResult.getDefaultInstance() + : outputResult_; + } else { + return outputResultBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + */ + public Builder setOutputResult(com.google.cloud.retail.v2beta.OutputResult value) { + if (outputResultBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputResult_ = value; + } else { + outputResultBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + */ + public Builder setOutputResult( + com.google.cloud.retail.v2beta.OutputResult.Builder builderForValue) { + if (outputResultBuilder_ == null) { + outputResult_ = builderForValue.build(); + } else { + outputResultBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + */ + public Builder mergeOutputResult(com.google.cloud.retail.v2beta.OutputResult value) { + if (outputResultBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && outputResult_ != null + && outputResult_ != com.google.cloud.retail.v2beta.OutputResult.getDefaultInstance()) { + getOutputResultBuilder().mergeFrom(value); + } else { + outputResult_ = value; + } + } else { + outputResultBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + */ + public Builder clearOutputResult() { + bitField0_ = (bitField0_ & ~0x00000004); + outputResult_ = null; + if (outputResultBuilder_ != null) { + outputResultBuilder_.dispose(); + outputResultBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + */ + public com.google.cloud.retail.v2beta.OutputResult.Builder getOutputResultBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getOutputResultFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + */ + public com.google.cloud.retail.v2beta.OutputResultOrBuilder getOutputResultOrBuilder() { + if (outputResultBuilder_ != null) { + return outputResultBuilder_.getMessageOrBuilder(); + } else { + return outputResult_ == null + ? com.google.cloud.retail.v2beta.OutputResult.getDefaultInstance() + : outputResult_; + } + } + /** + * + * + *
+     * Output result indicating where the data were exported to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputResult, + com.google.cloud.retail.v2beta.OutputResult.Builder, + com.google.cloud.retail.v2beta.OutputResultOrBuilder> + getOutputResultFieldBuilder() { + if (outputResultBuilder_ == null) { + outputResultBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputResult, + com.google.cloud.retail.v2beta.OutputResult.Builder, + com.google.cloud.retail.v2beta.OutputResultOrBuilder>( + getOutputResult(), getParentForChildren(), isClean()); + outputResult_ = null; + } + return outputResultBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse) + private static final com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse(); + } + + public static com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportAnalyticsMetricsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsResponseOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsResponseOrBuilder.java new file mode 100644 index 000000000000..5cd7bbbd9106 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportAnalyticsMetricsResponseOrBuilder.java @@ -0,0 +1,146 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2beta/export_config.proto + +package com.google.cloud.retail.v2beta; + +public interface ExportAnalyticsMetricsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.Status getErrorSamples(int index); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + int getErrorSamplesCount(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + java.util.List getErrorSamplesOrBuilderList(); + /** + * + * + *
+   * A sample of errors encountered while processing the request.
+   * 
+ * + * repeated .google.rpc.Status error_samples = 1; + */ + com.google.rpc.StatusOrBuilder getErrorSamplesOrBuilder(int index); + + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return Whether the errorsConfig field is set. + */ + boolean hasErrorsConfig(); + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + * + * @return The errorsConfig. + */ + com.google.cloud.retail.v2beta.ExportErrorsConfig getErrorsConfig(); + /** + * + * + *
+   * This field is never set.
+   * 
+ * + * .google.cloud.retail.v2beta.ExportErrorsConfig errors_config = 2; + */ + com.google.cloud.retail.v2beta.ExportErrorsConfigOrBuilder getErrorsConfigOrBuilder(); + + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + * + * @return Whether the outputResult field is set. + */ + boolean hasOutputResult(); + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + * + * @return The outputResult. + */ + com.google.cloud.retail.v2beta.OutputResult getOutputResult(); + /** + * + * + *
+   * Output result indicating where the data were exported to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputResult output_result = 3; + */ + com.google.cloud.retail.v2beta.OutputResultOrBuilder getOutputResultOrBuilder(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportConfigProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportConfigProto.java index ac62a308c1eb..4320b78b4066 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportConfigProto.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportConfigProto.java @@ -27,10 +27,26 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_OutputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_OutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_OutputConfig_GcsDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_OutputConfig_GcsDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_OutputConfig_BigQueryDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_OutputConfig_BigQueryDestination_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2beta_ExportMetadata_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -43,6 +59,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2beta_OutputResult_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -68,34 +88,52 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ig.proto\022\032google.cloud.retail.v2beta\032\037go" + "ogle/api/field_behavior.proto\032\031google/ap" + "i/resource.proto\032\037google/protobuf/timest" - + "amp.proto\032\027google/rpc/status.proto\"9\n\022Ex" - + "portErrorsConfig\022\024\n\ngcs_prefix\030\001 \001(\tH\000B\r" - + "\n\013destination\"r\n\016ExportMetadata\022/\n\013creat" - + "e_time\030\001 \001(\0132\032.google.protobuf.Timestamp" - + "\022/\n\013update_time\030\002 \001(\0132\032.google.protobuf." - + "Timestamp\"\313\001\n\026ExportProductsResponse\022)\n\r" - + "error_samples\030\001 \003(\0132\022.google.rpc.Status\022" - + "E\n\rerrors_config\030\002 \001(\0132..google.cloud.re" - + "tail.v2beta.ExportErrorsConfig\022?\n\routput" - + "_result\030\003 \001(\0132(.google.cloud.retail.v2be" - + "ta.OutputResult\"\315\001\n\030ExportUserEventsResp" - + "onse\022)\n\rerror_samples\030\001 \003(\0132\022.google.rpc" - + ".Status\022E\n\rerrors_config\030\002 \001(\0132..google." - + "cloud.retail.v2beta.ExportErrorsConfig\022?" - + "\n\routput_result\030\003 \001(\0132(.google.cloud.ret" - + "ail.v2beta.OutputResult\"\232\001\n\014OutputResult" - + "\022I\n\017bigquery_result\030\001 \003(\01320.google.cloud" - + ".retail.v2beta.BigQueryOutputResult\022?\n\ng" - + "cs_result\030\002 \003(\0132+.google.cloud.retail.v2" - + "beta.GcsOutputResult\"<\n\024BigQueryOutputRe" - + "sult\022\022\n\ndataset_id\030\001 \001(\t\022\020\n\010table_id\030\002 \001" - + "(\t\"%\n\017GcsOutputResult\022\022\n\noutput_uri\030\001 \001(" - + "\tB\320\001\n\036com.google.cloud.retail.v2betaB\021Ex" - + "portConfigProtoP\001Z6cloud.google.com/go/r" - + "etail/apiv2beta/retailpb;retailpb\242\002\006RETA" - + "IL\252\002\032Google.Cloud.Retail.V2Beta\312\002\032Google" - + "\\Cloud\\Retail\\V2beta\352\002\035Google::Cloud::Re" - + "tail::V2betab\006proto3" + + "amp.proto\032\027google/rpc/status.proto\"\354\002\n\014O" + + "utputConfig\022R\n\017gcs_destination\030\001 \001(\01327.g" + + "oogle.cloud.retail.v2beta.OutputConfig.G" + + "csDestinationH\000\022\\\n\024bigquery_destination\030" + + "\002 \001(\0132<.google.cloud.retail.v2beta.Outpu" + + "tConfig.BigQueryDestinationH\000\0321\n\016GcsDest" + + "ination\022\037\n\021output_uri_prefix\030\001 \001(\tB\004\342A\001\002" + + "\032h\n\023BigQueryDestination\022\030\n\ndataset_id\030\001 " + + "\001(\tB\004\342A\001\002\022\035\n\017table_id_prefix\030\002 \001(\tB\004\342A\001\002" + + "\022\030\n\ntable_type\030\003 \001(\tB\004\342A\001\002B\r\n\013destinatio" + + "n\"9\n\022ExportErrorsConfig\022\024\n\ngcs_prefix\030\001 " + + "\001(\tH\000B\r\n\013destination\"\215\001\n\035ExportAnalytics" + + "MetricsRequest\022\025\n\007catalog\030\001 \001(\tB\004\342A\001\002\022E\n" + + "\routput_config\030\002 \001(\0132(.google.cloud.reta" + + "il.v2beta.OutputConfigB\004\342A\001\002\022\016\n\006filter\030\003" + + " \001(\t\"r\n\016ExportMetadata\022/\n\013create_time\030\001 " + + "\001(\0132\032.google.protobuf.Timestamp\022/\n\013updat" + + "e_time\030\002 \001(\0132\032.google.protobuf.Timestamp" + + "\"\313\001\n\026ExportProductsResponse\022)\n\rerror_sam" + + "ples\030\001 \003(\0132\022.google.rpc.Status\022E\n\rerrors" + + "_config\030\002 \001(\0132..google.cloud.retail.v2be" + + "ta.ExportErrorsConfig\022?\n\routput_result\030\003" + + " \001(\0132(.google.cloud.retail.v2beta.Output" + + "Result\"\315\001\n\030ExportUserEventsResponse\022)\n\re" + + "rror_samples\030\001 \003(\0132\022.google.rpc.Status\022E" + + "\n\rerrors_config\030\002 \001(\0132..google.cloud.ret" + + "ail.v2beta.ExportErrorsConfig\022?\n\routput_" + + "result\030\003 \001(\0132(.google.cloud.retail.v2bet" + + "a.OutputResult\"\323\001\n\036ExportAnalyticsMetric" + + "sResponse\022)\n\rerror_samples\030\001 \003(\0132\022.googl" + + "e.rpc.Status\022E\n\rerrors_config\030\002 \001(\0132..go" + + "ogle.cloud.retail.v2beta.ExportErrorsCon" + + "fig\022?\n\routput_result\030\003 \001(\0132(.google.clou" + + "d.retail.v2beta.OutputResult\"\232\001\n\014OutputR" + + "esult\022I\n\017bigquery_result\030\001 \003(\01320.google." + + "cloud.retail.v2beta.BigQueryOutputResult" + + "\022?\n\ngcs_result\030\002 \003(\0132+.google.cloud.reta" + + "il.v2beta.GcsOutputResult\"<\n\024BigQueryOut" + + "putResult\022\022\n\ndataset_id\030\001 \001(\t\022\020\n\010table_i" + + "d\030\002 \001(\t\"%\n\017GcsOutputResult\022\022\n\noutput_uri" + + "\030\001 \001(\tB\320\001\n\036com.google.cloud.retail.v2bet" + + "aB\021ExportConfigProtoP\001Z6cloud.google.com" + + "/go/retail/apiv2beta/retailpb;retailpb\242\002" + + "\006RETAIL\252\002\032Google.Cloud.Retail.V2Beta\312\002\032G" + + "oogle\\Cloud\\Retail\\V2beta\352\002\035Google::Clou" + + "d::Retail::V2betab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -106,16 +144,48 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.TimestampProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), }); - internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_descriptor = + internal_static_google_cloud_retail_v2beta_OutputConfig_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_OutputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_OutputConfig_descriptor, + new java.lang.String[] { + "GcsDestination", "BigqueryDestination", "Destination", + }); + internal_static_google_cloud_retail_v2beta_OutputConfig_GcsDestination_descriptor = + internal_static_google_cloud_retail_v2beta_OutputConfig_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2beta_OutputConfig_GcsDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_OutputConfig_GcsDestination_descriptor, + new java.lang.String[] { + "OutputUriPrefix", + }); + internal_static_google_cloud_retail_v2beta_OutputConfig_BigQueryDestination_descriptor = + internal_static_google_cloud_retail_v2beta_OutputConfig_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_retail_v2beta_OutputConfig_BigQueryDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_OutputConfig_BigQueryDestination_descriptor, + new java.lang.String[] { + "DatasetId", "TableIdPrefix", "TableType", + }); + internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_descriptor = + getDescriptor().getMessageTypes().get(1); internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2beta_ExportErrorsConfig_descriptor, new java.lang.String[] { "GcsPrefix", "Destination", }); + internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsRequest_descriptor, + new java.lang.String[] { + "Catalog", "OutputConfig", "Filter", + }); internal_static_google_cloud_retail_v2beta_ExportMetadata_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(3); internal_static_google_cloud_retail_v2beta_ExportMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2beta_ExportMetadata_descriptor, @@ -123,7 +193,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CreateTime", "UpdateTime", }); internal_static_google_cloud_retail_v2beta_ExportProductsResponse_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(4); internal_static_google_cloud_retail_v2beta_ExportProductsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2beta_ExportProductsResponse_descriptor, @@ -131,15 +201,23 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ErrorSamples", "ErrorsConfig", "OutputResult", }); internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(5); internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2beta_ExportUserEventsResponse_descriptor, new java.lang.String[] { "ErrorSamples", "ErrorsConfig", "OutputResult", }); + internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ExportAnalyticsMetricsResponse_descriptor, + new java.lang.String[] { + "ErrorSamples", "ErrorsConfig", "OutputResult", + }); internal_static_google_cloud_retail_v2beta_OutputResult_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(7); internal_static_google_cloud_retail_v2beta_OutputResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2beta_OutputResult_descriptor, @@ -147,7 +225,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "BigqueryResult", "GcsResult", }); internal_static_google_cloud_retail_v2beta_BigQueryOutputResult_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(8); internal_static_google_cloud_retail_v2beta_BigQueryOutputResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2beta_BigQueryOutputResult_descriptor, @@ -155,13 +233,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DatasetId", "TableId", }); internal_static_google_cloud_retail_v2beta_GcsOutputResult_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(9); internal_static_google_cloud_retail_v2beta_GcsOutputResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2beta_GcsOutputResult_descriptor, new java.lang.String[] { "OutputUri", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/OutputConfig.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/OutputConfig.java new file mode 100644 index 000000000000..e59a803b4da3 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/OutputConfig.java @@ -0,0 +1,2935 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2beta/export_config.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * The output configuration setting.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.OutputConfig} + */ +public final class OutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.OutputConfig) + OutputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use OutputConfig.newBuilder() to construct. + private OutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OutputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OutputConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.OutputConfig.class, + com.google.cloud.retail.v2beta.OutputConfig.Builder.class); + } + + public interface GcsDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.OutputConfig.GcsDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The output uri prefix for saving output data to json files.
+     * Some mapping examples are as follows:
+     * output_uri_prefix         sample output(assuming the object is foo.json)
+     * ========================  =============================================
+     * gs://bucket/              gs://bucket/foo.json
+     * gs://bucket/folder/       gs://bucket/folder/foo.json
+     * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUriPrefix. + */ + java.lang.String getOutputUriPrefix(); + /** + * + * + *
+     * Required. The output uri prefix for saving output data to json files.
+     * Some mapping examples are as follows:
+     * output_uri_prefix         sample output(assuming the object is foo.json)
+     * ========================  =============================================
+     * gs://bucket/              gs://bucket/foo.json
+     * gs://bucket/folder/       gs://bucket/folder/foo.json
+     * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUriPrefix. + */ + com.google.protobuf.ByteString getOutputUriPrefixBytes(); + } + /** + * + * + *
+   * The Google Cloud Storage output destination configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.OutputConfig.GcsDestination} + */ + public static final class GcsDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.OutputConfig.GcsDestination) + GcsDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsDestination.newBuilder() to construct. + private GcsDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsDestination() { + outputUriPrefix_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsDestination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.class, + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.Builder.class); + } + + public static final int OUTPUT_URI_PREFIX_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object outputUriPrefix_ = ""; + /** + * + * + *
+     * Required. The output uri prefix for saving output data to json files.
+     * Some mapping examples are as follows:
+     * output_uri_prefix         sample output(assuming the object is foo.json)
+     * ========================  =============================================
+     * gs://bucket/              gs://bucket/foo.json
+     * gs://bucket/folder/       gs://bucket/folder/foo.json
+     * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUriPrefix. + */ + @java.lang.Override + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUriPrefix_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The output uri prefix for saving output data to json files.
+     * Some mapping examples are as follows:
+     * output_uri_prefix         sample output(assuming the object is foo.json)
+     * ========================  =============================================
+     * gs://bucket/              gs://bucket/foo.json
+     * gs://bucket/folder/       gs://bucket/folder/foo.json
+     * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+     * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUriPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUriPrefix_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, outputUriPrefix_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(outputUriPrefix_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, outputUriPrefix_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2beta.OutputConfig.GcsDestination)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination other = + (com.google.cloud.retail.v2beta.OutputConfig.GcsDestination) obj; + + if (!getOutputUriPrefix().equals(other.getOutputUriPrefix())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + OUTPUT_URI_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getOutputUriPrefix().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The Google Cloud Storage output destination configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.OutputConfig.GcsDestination} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.OutputConfig.GcsDestination) + com.google.cloud.retail.v2beta.OutputConfig.GcsDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.class, + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + outputUriPrefix_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_GcsDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.GcsDestination + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.GcsDestination build() { + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.GcsDestination buildPartial() { + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination result = + new com.google.cloud.retail.v2beta.OutputConfig.GcsDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.outputUriPrefix_ = outputUriPrefix_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2beta.OutputConfig.GcsDestination) { + return mergeFrom((com.google.cloud.retail.v2beta.OutputConfig.GcsDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.OutputConfig.GcsDestination other) { + if (other + == com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.getDefaultInstance()) + return this; + if (!other.getOutputUriPrefix().isEmpty()) { + outputUriPrefix_ = other.outputUriPrefix_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + outputUriPrefix_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object outputUriPrefix_ = ""; + /** + * + * + *
+       * Required. The output uri prefix for saving output data to json files.
+       * Some mapping examples are as follows:
+       * output_uri_prefix         sample output(assuming the object is foo.json)
+       * ========================  =============================================
+       * gs://bucket/              gs://bucket/foo.json
+       * gs://bucket/folder/       gs://bucket/folder/foo.json
+       * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+       * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The outputUriPrefix. + */ + public java.lang.String getOutputUriPrefix() { + java.lang.Object ref = outputUriPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUriPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The output uri prefix for saving output data to json files.
+       * Some mapping examples are as follows:
+       * output_uri_prefix         sample output(assuming the object is foo.json)
+       * ========================  =============================================
+       * gs://bucket/              gs://bucket/foo.json
+       * gs://bucket/folder/       gs://bucket/folder/foo.json
+       * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+       * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for outputUriPrefix. + */ + public com.google.protobuf.ByteString getOutputUriPrefixBytes() { + java.lang.Object ref = outputUriPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + outputUriPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The output uri prefix for saving output data to json files.
+       * Some mapping examples are as follows:
+       * output_uri_prefix         sample output(assuming the object is foo.json)
+       * ========================  =============================================
+       * gs://bucket/              gs://bucket/foo.json
+       * gs://bucket/folder/       gs://bucket/folder/foo.json
+       * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+       * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The outputUriPrefix to set. + * @return This builder for chaining. + */ + public Builder setOutputUriPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + outputUriPrefix_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The output uri prefix for saving output data to json files.
+       * Some mapping examples are as follows:
+       * output_uri_prefix         sample output(assuming the object is foo.json)
+       * ========================  =============================================
+       * gs://bucket/              gs://bucket/foo.json
+       * gs://bucket/folder/       gs://bucket/folder/foo.json
+       * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+       * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearOutputUriPrefix() { + outputUriPrefix_ = getDefaultInstance().getOutputUriPrefix(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The output uri prefix for saving output data to json files.
+       * Some mapping examples are as follows:
+       * output_uri_prefix         sample output(assuming the object is foo.json)
+       * ========================  =============================================
+       * gs://bucket/              gs://bucket/foo.json
+       * gs://bucket/folder/       gs://bucket/folder/foo.json
+       * gs://bucket/folder/item_  gs://bucket/folder/item_foo.json
+       * 
+ * + * string output_uri_prefix = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for outputUriPrefix to set. + * @return This builder for chaining. + */ + public Builder setOutputUriPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + outputUriPrefix_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2beta.OutputConfig.GcsDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.OutputConfig.GcsDestination) + private static final com.google.cloud.retail.v2beta.OutputConfig.GcsDestination + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.OutputConfig.GcsDestination(); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.GcsDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.GcsDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface BigQueryDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Required. The ID of a BigQuery Dataset.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + java.lang.String getDatasetId(); + /** + * + * + *
+     * Required. The ID of a BigQuery Dataset.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + com.google.protobuf.ByteString getDatasetIdBytes(); + + /** + * + * + *
+     * Required. The prefix of exported BigQuery tables.
+     * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableIdPrefix. + */ + java.lang.String getTableIdPrefix(); + /** + * + * + *
+     * Required. The prefix of exported BigQuery tables.
+     * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableIdPrefix. + */ + com.google.protobuf.ByteString getTableIdPrefixBytes(); + + /** + * + * + *
+     * Required. Describes the table type. The following values are supported:
+     *
+     * * `table`: A BigQuery native table.
+     * * `view`: A virtual table defined by a SQL query.
+     * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableType. + */ + java.lang.String getTableType(); + /** + * + * + *
+     * Required. Describes the table type. The following values are supported:
+     *
+     * * `table`: A BigQuery native table.
+     * * `view`: A virtual table defined by a SQL query.
+     * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableType. + */ + com.google.protobuf.ByteString getTableTypeBytes(); + } + /** + * + * + *
+   * The BigQuery output destination configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.OutputConfig.BigQueryDestination} + */ + public static final class BigQueryDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) + BigQueryDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use BigQueryDestination.newBuilder() to construct. + private BigQueryDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigQueryDestination() { + datasetId_ = ""; + tableIdPrefix_ = ""; + tableType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BigQueryDestination(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_BigQueryDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_BigQueryDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.class, + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.Builder.class); + } + + public static final int DATASET_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object datasetId_ = ""; + /** + * + * + *
+     * Required. The ID of a BigQuery Dataset.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + @java.lang.Override + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The ID of a BigQuery Dataset.
+     * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_ID_PREFIX_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableIdPrefix_ = ""; + /** + * + * + *
+     * Required. The prefix of exported BigQuery tables.
+     * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableIdPrefix. + */ + @java.lang.Override + public java.lang.String getTableIdPrefix() { + java.lang.Object ref = tableIdPrefix_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableIdPrefix_ = s; + return s; + } + } + /** + * + * + *
+     * Required. The prefix of exported BigQuery tables.
+     * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableIdPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableIdPrefixBytes() { + java.lang.Object ref = tableIdPrefix_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableIdPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_TYPE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object tableType_ = ""; + /** + * + * + *
+     * Required. Describes the table type. The following values are supported:
+     *
+     * * `table`: A BigQuery native table.
+     * * `view`: A virtual table defined by a SQL query.
+     * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableType. + */ + @java.lang.Override + public java.lang.String getTableType() { + java.lang.Object ref = tableType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableType_ = s; + return s; + } + } + /** + * + * + *
+     * Required. Describes the table type. The following values are supported:
+     *
+     * * `table`: A BigQuery native table.
+     * * `view`: A virtual table defined by a SQL query.
+     * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableTypeBytes() { + java.lang.Object ref = tableType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableIdPrefix_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, tableIdPrefix_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, tableType_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(datasetId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, datasetId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableIdPrefix_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, tableIdPrefix_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tableType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, tableType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination other = + (com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) obj; + + if (!getDatasetId().equals(other.getDatasetId())) return false; + if (!getTableIdPrefix().equals(other.getTableIdPrefix())) return false; + if (!getTableType().equals(other.getTableType())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DATASET_ID_FIELD_NUMBER; + hash = (53 * hash) + getDatasetId().hashCode(); + hash = (37 * hash) + TABLE_ID_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getTableIdPrefix().hashCode(); + hash = (37 * hash) + TABLE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getTableType().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The BigQuery output destination configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.OutputConfig.BigQueryDestination} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_BigQueryDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_BigQueryDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.class, + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + datasetId_ = ""; + tableIdPrefix_ = ""; + tableType_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_BigQueryDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination build() { + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination buildPartial() { + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination result = + new com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.datasetId_ = datasetId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tableIdPrefix_ = tableIdPrefix_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.tableType_ = tableType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) { + return mergeFrom((com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination other) { + if (other + == com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.getDefaultInstance()) + return this; + if (!other.getDatasetId().isEmpty()) { + datasetId_ = other.datasetId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getTableIdPrefix().isEmpty()) { + tableIdPrefix_ = other.tableIdPrefix_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getTableType().isEmpty()) { + tableType_ = other.tableType_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + datasetId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + tableIdPrefix_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + tableType_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object datasetId_ = ""; + /** + * + * + *
+       * Required. The ID of a BigQuery Dataset.
+       * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The datasetId. + */ + public java.lang.String getDatasetId() { + java.lang.Object ref = datasetId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + datasetId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The ID of a BigQuery Dataset.
+       * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for datasetId. + */ + public com.google.protobuf.ByteString getDatasetIdBytes() { + java.lang.Object ref = datasetId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + datasetId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The ID of a BigQuery Dataset.
+       * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + datasetId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The ID of a BigQuery Dataset.
+       * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDatasetId() { + datasetId_ = getDefaultInstance().getDatasetId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The ID of a BigQuery Dataset.
+       * 
+ * + * string dataset_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for datasetId to set. + * @return This builder for chaining. + */ + public Builder setDatasetIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + datasetId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object tableIdPrefix_ = ""; + /** + * + * + *
+       * Required. The prefix of exported BigQuery tables.
+       * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableIdPrefix. + */ + public java.lang.String getTableIdPrefix() { + java.lang.Object ref = tableIdPrefix_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableIdPrefix_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. The prefix of exported BigQuery tables.
+       * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableIdPrefix. + */ + public com.google.protobuf.ByteString getTableIdPrefixBytes() { + java.lang.Object ref = tableIdPrefix_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableIdPrefix_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. The prefix of exported BigQuery tables.
+       * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The tableIdPrefix to set. + * @return This builder for chaining. + */ + public Builder setTableIdPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableIdPrefix_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The prefix of exported BigQuery tables.
+       * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTableIdPrefix() { + tableIdPrefix_ = getDefaultInstance().getTableIdPrefix(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The prefix of exported BigQuery tables.
+       * 
+ * + * string table_id_prefix = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for tableIdPrefix to set. + * @return This builder for chaining. + */ + public Builder setTableIdPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableIdPrefix_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object tableType_ = ""; + /** + * + * + *
+       * Required. Describes the table type. The following values are supported:
+       *
+       * * `table`: A BigQuery native table.
+       * * `view`: A virtual table defined by a SQL query.
+       * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The tableType. + */ + public java.lang.String getTableType() { + java.lang.Object ref = tableType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tableType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Required. Describes the table type. The following values are supported:
+       *
+       * * `table`: A BigQuery native table.
+       * * `view`: A virtual table defined by a SQL query.
+       * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for tableType. + */ + public com.google.protobuf.ByteString getTableTypeBytes() { + java.lang.Object ref = tableType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tableType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Required. Describes the table type. The following values are supported:
+       *
+       * * `table`: A BigQuery native table.
+       * * `view`: A virtual table defined by a SQL query.
+       * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The tableType to set. + * @return This builder for chaining. + */ + public Builder setTableType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + tableType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Describes the table type. The following values are supported:
+       *
+       * * `table`: A BigQuery native table.
+       * * `view`: A virtual table defined by a SQL query.
+       * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTableType() { + tableType_ = getDefaultInstance().getTableType(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Required. Describes the table type. The following values are supported:
+       *
+       * * `table`: A BigQuery native table.
+       * * `view`: A virtual table defined by a SQL query.
+       * 
+ * + * string table_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for tableType to set. + * @return This builder for chaining. + */ + public Builder setTableTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + tableType_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) + private static final com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination(); + } + + public static com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigQueryDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int destinationCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_DESTINATION(1), + BIGQUERY_DESTINATION(2), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_DESTINATION; + case 2: + return BIGQUERY_DESTINATION; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.GcsDestination getGcsDestination() { + if (destinationCase_ == 1) { + return (com.google.cloud.retail.v2beta.OutputConfig.GcsDestination) destination_; + } + return com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.getDefaultInstance(); + } + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.GcsDestinationOrBuilder + getGcsDestinationOrBuilder() { + if (destinationCase_ == 1) { + return (com.google.cloud.retail.v2beta.OutputConfig.GcsDestination) destination_; + } + return com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.getDefaultInstance(); + } + + public static final int BIGQUERY_DESTINATION_FIELD_NUMBER = 2; + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return Whether the bigqueryDestination field is set. + */ + @java.lang.Override + public boolean hasBigqueryDestination() { + return destinationCase_ == 2; + } + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return The bigqueryDestination. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination getBigqueryDestination() { + if (destinationCase_ == 2) { + return (com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) destination_; + } + return com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.getDefaultInstance(); + } + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestinationOrBuilder + getBigqueryDestinationOrBuilder() { + if (destinationCase_ == 2) { + return (com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) destination_; + } + return com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (destinationCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.retail.v2beta.OutputConfig.GcsDestination) destination_); + } + if (destinationCase_ == 2) { + output.writeMessage( + 2, (com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) destination_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.retail.v2beta.OutputConfig.GcsDestination) destination_); + } + if (destinationCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) destination_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.retail.v2beta.OutputConfig)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.OutputConfig other = + (com.google.cloud.retail.v2beta.OutputConfig) obj; + + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsDestination().equals(other.getGcsDestination())) return false; + break; + case 2: + if (!getBigqueryDestination().equals(other.getBigqueryDestination())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getGcsDestination().hashCode(); + break; + case 2: + hash = (37 * hash) + BIGQUERY_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getBigqueryDestination().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.OutputConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.retail.v2beta.OutputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The output configuration setting.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.OutputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.OutputConfig) + com.google.cloud.retail.v2beta.OutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.OutputConfig.class, + com.google.cloud.retail.v2beta.OutputConfig.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.OutputConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (gcsDestinationBuilder_ != null) { + gcsDestinationBuilder_.clear(); + } + if (bigqueryDestinationBuilder_ != null) { + bigqueryDestinationBuilder_.clear(); + } + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ExportConfigProto + .internal_static_google_cloud_retail_v2beta_OutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.OutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig build() { + com.google.cloud.retail.v2beta.OutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig buildPartial() { + com.google.cloud.retail.v2beta.OutputConfig result = + new com.google.cloud.retail.v2beta.OutputConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.retail.v2beta.OutputConfig result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.retail.v2beta.OutputConfig result) { + result.destinationCase_ = destinationCase_; + result.destination_ = this.destination_; + if (destinationCase_ == 1 && gcsDestinationBuilder_ != null) { + result.destination_ = gcsDestinationBuilder_.build(); + } + if (destinationCase_ == 2 && bigqueryDestinationBuilder_ != null) { + result.destination_ = bigqueryDestinationBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.retail.v2beta.OutputConfig) { + return mergeFrom((com.google.cloud.retail.v2beta.OutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.OutputConfig other) { + if (other == com.google.cloud.retail.v2beta.OutputConfig.getDefaultInstance()) return this; + switch (other.getDestinationCase()) { + case GCS_DESTINATION: + { + mergeGcsDestination(other.getGcsDestination()); + break; + } + case BIGQUERY_DESTINATION: + { + mergeBigqueryDestination(other.getBigqueryDestination()); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getGcsDestinationFieldBuilder().getBuilder(), extensionRegistry); + destinationCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage( + getBigqueryDestinationFieldBuilder().getBuilder(), extensionRegistry); + destinationCase_ = 2; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination, + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.Builder, + com.google.cloud.retail.v2beta.OutputConfig.GcsDestinationOrBuilder> + gcsDestinationBuilder_; + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + return (com.google.cloud.retail.v2beta.OutputConfig.GcsDestination) destination_; + } + return com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 1) { + return gcsDestinationBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination( + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination( + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + */ + public Builder mergeGcsDestination( + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1 + && destination_ + != com.google.cloud.retail.v2beta.OutputConfig.GcsDestination + .getDefaultInstance()) { + destination_ = + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.newBuilder( + (com.google.cloud.retail.v2beta.OutputConfig.GcsDestination) destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 1) { + gcsDestinationBuilder_.mergeFrom(value); + } else { + gcsDestinationBuilder_.setMessage(value); + } + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + */ + public Builder clearGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + } + gcsDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.Builder + getGcsDestinationBuilder() { + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.GcsDestinationOrBuilder + getGcsDestinationOrBuilder() { + if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 1) { + return (com.google.cloud.retail.v2beta.OutputConfig.GcsDestination) destination_; + } + return com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * The Google Cloud Storage location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination, + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.Builder, + com.google.cloud.retail.v2beta.OutputConfig.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + if (!(destinationCase_ == 1)) { + destination_ = + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.getDefaultInstance(); + } + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination, + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination.Builder, + com.google.cloud.retail.v2beta.OutputConfig.GcsDestinationOrBuilder>( + (com.google.cloud.retail.v2beta.OutputConfig.GcsDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 1; + onChanged(); + return gcsDestinationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination, + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.Builder, + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestinationOrBuilder> + bigqueryDestinationBuilder_; + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return Whether the bigqueryDestination field is set. + */ + @java.lang.Override + public boolean hasBigqueryDestination() { + return destinationCase_ == 2; + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return The bigqueryDestination. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination + getBigqueryDestination() { + if (bigqueryDestinationBuilder_ == null) { + if (destinationCase_ == 2) { + return (com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) destination_; + } + return com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 2) { + return bigqueryDestinationBuilder_.getMessage(); + } + return com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + public Builder setBigqueryDestination( + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination value) { + if (bigqueryDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + bigqueryDestinationBuilder_.setMessage(value); + } + destinationCase_ = 2; + return this; + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + public Builder setBigqueryDestination( + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.Builder builderForValue) { + if (bigqueryDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + bigqueryDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 2; + return this; + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + public Builder mergeBigqueryDestination( + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination value) { + if (bigqueryDestinationBuilder_ == null) { + if (destinationCase_ == 2 + && destination_ + != com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination + .getDefaultInstance()) { + destination_ = + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.newBuilder( + (com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) + destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 2) { + bigqueryDestinationBuilder_.mergeFrom(value); + } else { + bigqueryDestinationBuilder_.setMessage(value); + } + } + destinationCase_ = 2; + return this; + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + public Builder clearBigqueryDestination() { + if (bigqueryDestinationBuilder_ == null) { + if (destinationCase_ == 2) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 2) { + destinationCase_ = 0; + destination_ = null; + } + bigqueryDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + public com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.Builder + getBigqueryDestinationBuilder() { + return getBigqueryDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestinationOrBuilder + getBigqueryDestinationOrBuilder() { + if ((destinationCase_ == 2) && (bigqueryDestinationBuilder_ != null)) { + return bigqueryDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 2) { + return (com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) destination_; + } + return com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * The BigQuery location where the output is to be written to.
+     * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination, + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.Builder, + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestinationOrBuilder> + getBigqueryDestinationFieldBuilder() { + if (bigqueryDestinationBuilder_ == null) { + if (!(destinationCase_ == 2)) { + destination_ = + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.getDefaultInstance(); + } + bigqueryDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination, + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination.Builder, + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestinationOrBuilder>( + (com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 2; + onChanged(); + return bigqueryDestinationBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2beta.OutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.OutputConfig) + private static final com.google.cloud.retail.v2beta.OutputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.OutputConfig(); + } + + public static com.google.cloud.retail.v2beta.OutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.OutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/OutputConfigOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/OutputConfigOrBuilder.java new file mode 100644 index 000000000000..90937435a21d --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/OutputConfigOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/retail/v2beta/export_config.proto + +package com.google.cloud.retail.v2beta; + +public interface OutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.OutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + boolean hasGcsDestination(); + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + com.google.cloud.retail.v2beta.OutputConfig.GcsDestination getGcsDestination(); + /** + * + * + *
+   * The Google Cloud Storage location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.GcsDestination gcs_destination = 1; + */ + com.google.cloud.retail.v2beta.OutputConfig.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return Whether the bigqueryDestination field is set. + */ + boolean hasBigqueryDestination(); + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + * + * @return The bigqueryDestination. + */ + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestination getBigqueryDestination(); + /** + * + * + *
+   * The BigQuery location where the output is to be written to.
+   * 
+ * + * .google.cloud.retail.v2beta.OutputConfig.BigQueryDestination bigquery_destination = 2; + * + */ + com.google.cloud.retail.v2beta.OutputConfig.BigQueryDestinationOrBuilder + getBigqueryDestinationOrBuilder(); + + com.google.cloud.retail.v2beta.OutputConfig.DestinationCase getDestinationCase(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/analytics_service.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/analytics_service.proto new file mode 100644 index 000000000000..6782baf836c0 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/analytics_service.proto @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.retail.v2beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/retail/v2beta/export_config.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.Retail.V2Beta"; +option go_package = "cloud.google.com/go/retail/apiv2beta/retailpb;retailpb"; +option java_multiple_files = true; +option java_outer_classname = "AnalyticsServiceProto"; +option java_package = "com.google.cloud.retail.v2beta"; +option objc_class_prefix = "RETAIL"; +option php_namespace = "Google\\Cloud\\Retail\\V2beta"; +option ruby_package = "Google::Cloud::Retail::V2beta"; + +// Service for managing & accessing retail search business metric. +// Retail recommendation business metric is currently not available. +service AnalyticsService { + option (google.api.default_host) = "retail.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Exports analytics metrics. + // + // `Operation.response` is of type `ExportAnalyticsMetricsResponse`. + // `Operation.metadata` is of type `ExportMetadata`. + rpc ExportAnalyticsMetrics(ExportAnalyticsMetricsRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta/{catalog=projects/*/locations/*/catalogs/*}:exportAnalyticsMetrics" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse" + metadata_type: "google.cloud.retail.v2beta.ExportMetadata" + }; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/export_config.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/export_config.proto index 9efc0d195a62..303712b21624 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/export_config.proto +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/export_config.proto @@ -30,6 +30,45 @@ option objc_class_prefix = "RETAIL"; option php_namespace = "Google\\Cloud\\Retail\\V2beta"; option ruby_package = "Google::Cloud::Retail::V2beta"; +// The output configuration setting. +message OutputConfig { + // The Google Cloud Storage output destination configuration. + message GcsDestination { + // Required. The output uri prefix for saving output data to json files. + // Some mapping examples are as follows: + // output_uri_prefix sample output(assuming the object is foo.json) + // ======================== ============================================= + // gs://bucket/ gs://bucket/foo.json + // gs://bucket/folder/ gs://bucket/folder/foo.json + // gs://bucket/folder/item_ gs://bucket/folder/item_foo.json + string output_uri_prefix = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // The BigQuery output destination configuration. + message BigQueryDestination { + // Required. The ID of a BigQuery Dataset. + string dataset_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The prefix of exported BigQuery tables. + string table_id_prefix = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Describes the table type. The following values are supported: + // + // * `table`: A BigQuery native table. + // * `view`: A virtual table defined by a SQL query. + string table_type = 3 [(google.api.field_behavior) = REQUIRED]; + } + + // The configuration of destination for holding output data. + oneof destination { + // The Google Cloud Storage location where the output is to be written to. + GcsDestination gcs_destination = 1; + + // The BigQuery location where the output is to be written to. + BigQueryDestination bigquery_destination = 2; + } +} + // Configuration of destination for Export related errors. message ExportErrorsConfig { // Required. Errors destination. @@ -42,6 +81,35 @@ message ExportErrorsConfig { } } +// Request message for the `ExportAnalyticsMetrics` method. +message ExportAnalyticsMetricsRequest { + // Required. Full resource name of the parent catalog. + // Expected format: `projects/*/locations/*/catalogs/*` + string catalog = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The output location of the data. + OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; + + // A filtering expression to specify restrictions on returned metrics. + // The expression is a sequence of terms. Each term applies a restriction to + // the returned metrics. Use this expression to restrict results to a + // specific time range. + // + // Currently we expect only one types of fields: + // + // * `timestamp`: This can be specified twice, once with a + // less than operator and once with a greater than operator. The + // `timestamp` restriction should result in one, contiguous, valid, + // `timestamp` range. + // + // Some examples of valid filters expressions: + // + // * Example 1: `timestamp > "2012-04-23T18:25:43.511Z" + // timestamp < "2012-04-23T18:30:43.511Z"` + // * Example 2: `timestamp > "2012-04-23T18:25:43.511Z"` + string filter = 3; +} + // Metadata related to the progress of the Export operation. This is // returned by the google.longrunning.Operation.metadata field. message ExportMetadata { @@ -81,6 +149,20 @@ message ExportUserEventsResponse { OutputResult output_result = 3; } +// Response of the ExportAnalyticsMetricsRequest. If the long running +// operation was successful, then this message is returned by the +// google.longrunning.Operations.response field if the operation was successful. +message ExportAnalyticsMetricsResponse { + // A sample of errors encountered while processing the request. + repeated google.rpc.Status error_samples = 1; + + // This field is never set. + ExportErrorsConfig errors_config = 2; + + // Output result indicating where the data were exported to. + OutputResult output_result = 3; +} + // Output result that stores the information about where the exported data is // stored. message OutputResult { diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/create/SyncCreateSetCredentialsProvider.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..f1009e1fdf8f --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.samples; + +// [START retail_v2alpha_generated_AnalyticsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.retail.v2alpha.AnalyticsServiceClient; +import com.google.cloud.retail.v2alpha.AnalyticsServiceSettings; +import com.google.cloud.retail.v2alpha.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AnalyticsServiceSettings analyticsServiceSettings = + AnalyticsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AnalyticsServiceClient analyticsServiceClient = + AnalyticsServiceClient.create(analyticsServiceSettings); + } +} +// [END retail_v2alpha_generated_AnalyticsService_Create_SetCredentialsProvider_sync] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/create/SyncCreateSetCredentialsProvider1.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..89c3caae94e0 --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.samples; + +// [START retail_v2alpha_generated_AnalyticsService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.retail.v2alpha.AnalyticsServiceClient; +import com.google.cloud.retail.v2alpha.AnalyticsServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AnalyticsServiceSettings analyticsServiceSettings = + AnalyticsServiceSettings.newHttpJsonBuilder().build(); + AnalyticsServiceClient analyticsServiceClient = + AnalyticsServiceClient.create(analyticsServiceSettings); + } +} +// [END retail_v2alpha_generated_AnalyticsService_Create_SetCredentialsProvider1_sync] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/create/SyncCreateSetEndpoint.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..e484ad39b11a --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.samples; + +// [START retail_v2alpha_generated_AnalyticsService_Create_SetEndpoint_sync] +import com.google.cloud.retail.v2alpha.AnalyticsServiceClient; +import com.google.cloud.retail.v2alpha.AnalyticsServiceSettings; +import com.google.cloud.retail.v2alpha.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AnalyticsServiceSettings analyticsServiceSettings = + AnalyticsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + AnalyticsServiceClient analyticsServiceClient = + AnalyticsServiceClient.create(analyticsServiceSettings); + } +} +// [END retail_v2alpha_generated_AnalyticsService_Create_SetEndpoint_sync] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetrics.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetrics.java new file mode 100644 index 000000000000..7405c4b54fd5 --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetrics.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.samples; + +// [START retail_v2alpha_generated_AnalyticsService_ExportAnalyticsMetrics_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.retail.v2alpha.AnalyticsServiceClient; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2alpha.OutputConfig; +import com.google.longrunning.Operation; + +public class AsyncExportAnalyticsMetrics { + + public static void main(String[] args) throws Exception { + asyncExportAnalyticsMetrics(); + } + + public static void asyncExportAnalyticsMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) { + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("catalog555704345") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + analyticsServiceClient.exportAnalyticsMetricsCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END retail_v2alpha_generated_AnalyticsService_ExportAnalyticsMetrics_async] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetricsLRO.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetricsLRO.java new file mode 100644 index 000000000000..1bcdac2917db --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetricsLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.samples; + +// [START retail_v2alpha_generated_AnalyticsService_ExportAnalyticsMetrics_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.retail.v2alpha.AnalyticsServiceClient; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2alpha.ExportMetadata; +import com.google.cloud.retail.v2alpha.OutputConfig; + +public class AsyncExportAnalyticsMetricsLRO { + + public static void main(String[] args) throws Exception { + asyncExportAnalyticsMetricsLRO(); + } + + public static void asyncExportAnalyticsMetricsLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) { + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("catalog555704345") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + OperationFuture future = + analyticsServiceClient.exportAnalyticsMetricsOperationCallable().futureCall(request); + // Do something. + ExportAnalyticsMetricsResponse response = future.get(); + } + } +} +// [END retail_v2alpha_generated_AnalyticsService_ExportAnalyticsMetrics_LRO_async] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java new file mode 100644 index 000000000000..a9bfc65c0a2b --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservice/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.samples; + +// [START retail_v2alpha_generated_AnalyticsService_ExportAnalyticsMetrics_sync] +import com.google.cloud.retail.v2alpha.AnalyticsServiceClient; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2alpha.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2alpha.OutputConfig; + +public class SyncExportAnalyticsMetrics { + + public static void main(String[] args) throws Exception { + syncExportAnalyticsMetrics(); + } + + public static void syncExportAnalyticsMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) { + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("catalog555704345") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + ExportAnalyticsMetricsResponse response = + analyticsServiceClient.exportAnalyticsMetricsAsync(request).get(); + } + } +} +// [END retail_v2alpha_generated_AnalyticsService_ExportAnalyticsMetrics_sync] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservicesettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservicesettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java new file mode 100644 index 000000000000..ed5ad3eb85fb --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/analyticsservicesettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.samples; + +// [START retail_v2alpha_generated_AnalyticsServiceSettings_ExportAnalyticsMetrics_sync] +import com.google.cloud.retail.v2alpha.AnalyticsServiceSettings; +import java.time.Duration; + +public class SyncExportAnalyticsMetrics { + + public static void main(String[] args) throws Exception { + syncExportAnalyticsMetrics(); + } + + public static void syncExportAnalyticsMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AnalyticsServiceSettings.Builder analyticsServiceSettingsBuilder = + AnalyticsServiceSettings.newBuilder(); + analyticsServiceSettingsBuilder + .exportAnalyticsMetricsSettings() + .setRetrySettings( + analyticsServiceSettingsBuilder + .exportAnalyticsMetricsSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AnalyticsServiceSettings analyticsServiceSettings = analyticsServiceSettingsBuilder.build(); + } +} +// [END retail_v2alpha_generated_AnalyticsServiceSettings_ExportAnalyticsMetrics_sync] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/stub/analyticsservicestubsettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/stub/analyticsservicestubsettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java new file mode 100644 index 000000000000..51bd9c2d8639 --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2alpha/stub/analyticsservicestubsettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2alpha.stub.samples; + +// [START retail_v2alpha_generated_AnalyticsServiceStubSettings_ExportAnalyticsMetrics_sync] +import com.google.cloud.retail.v2alpha.stub.AnalyticsServiceStubSettings; +import java.time.Duration; + +public class SyncExportAnalyticsMetrics { + + public static void main(String[] args) throws Exception { + syncExportAnalyticsMetrics(); + } + + public static void syncExportAnalyticsMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AnalyticsServiceStubSettings.Builder analyticsServiceSettingsBuilder = + AnalyticsServiceStubSettings.newBuilder(); + analyticsServiceSettingsBuilder + .exportAnalyticsMetricsSettings() + .setRetrySettings( + analyticsServiceSettingsBuilder + .exportAnalyticsMetricsSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AnalyticsServiceStubSettings analyticsServiceSettings = analyticsServiceSettingsBuilder.build(); + } +} +// [END retail_v2alpha_generated_AnalyticsServiceStubSettings_ExportAnalyticsMetrics_sync] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/create/SyncCreateSetCredentialsProvider.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..42a1b750a131 --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.samples; + +// [START retail_v2beta_generated_AnalyticsService_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.retail.v2beta.AnalyticsServiceClient; +import com.google.cloud.retail.v2beta.AnalyticsServiceSettings; +import com.google.cloud.retail.v2beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AnalyticsServiceSettings analyticsServiceSettings = + AnalyticsServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AnalyticsServiceClient analyticsServiceClient = + AnalyticsServiceClient.create(analyticsServiceSettings); + } +} +// [END retail_v2beta_generated_AnalyticsService_Create_SetCredentialsProvider_sync] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/create/SyncCreateSetCredentialsProvider1.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..4adbf4404c65 --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.samples; + +// [START retail_v2beta_generated_AnalyticsService_Create_SetCredentialsProvider1_sync] +import com.google.cloud.retail.v2beta.AnalyticsServiceClient; +import com.google.cloud.retail.v2beta.AnalyticsServiceSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AnalyticsServiceSettings analyticsServiceSettings = + AnalyticsServiceSettings.newHttpJsonBuilder().build(); + AnalyticsServiceClient analyticsServiceClient = + AnalyticsServiceClient.create(analyticsServiceSettings); + } +} +// [END retail_v2beta_generated_AnalyticsService_Create_SetCredentialsProvider1_sync] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/create/SyncCreateSetEndpoint.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..a202535eb5b1 --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.samples; + +// [START retail_v2beta_generated_AnalyticsService_Create_SetEndpoint_sync] +import com.google.cloud.retail.v2beta.AnalyticsServiceClient; +import com.google.cloud.retail.v2beta.AnalyticsServiceSettings; +import com.google.cloud.retail.v2beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AnalyticsServiceSettings analyticsServiceSettings = + AnalyticsServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + AnalyticsServiceClient analyticsServiceClient = + AnalyticsServiceClient.create(analyticsServiceSettings); + } +} +// [END retail_v2beta_generated_AnalyticsService_Create_SetEndpoint_sync] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetrics.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetrics.java new file mode 100644 index 000000000000..883996a81f44 --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetrics.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.samples; + +// [START retail_v2beta_generated_AnalyticsService_ExportAnalyticsMetrics_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.retail.v2beta.AnalyticsServiceClient; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2beta.OutputConfig; +import com.google.longrunning.Operation; + +public class AsyncExportAnalyticsMetrics { + + public static void main(String[] args) throws Exception { + asyncExportAnalyticsMetrics(); + } + + public static void asyncExportAnalyticsMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) { + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("catalog555704345") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + ApiFuture future = + analyticsServiceClient.exportAnalyticsMetricsCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END retail_v2beta_generated_AnalyticsService_ExportAnalyticsMetrics_async] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetricsLRO.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetricsLRO.java new file mode 100644 index 000000000000..af4010d12dc9 --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/exportanalyticsmetrics/AsyncExportAnalyticsMetricsLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.samples; + +// [START retail_v2beta_generated_AnalyticsService_ExportAnalyticsMetrics_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.retail.v2beta.AnalyticsServiceClient; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2beta.ExportMetadata; +import com.google.cloud.retail.v2beta.OutputConfig; + +public class AsyncExportAnalyticsMetricsLRO { + + public static void main(String[] args) throws Exception { + asyncExportAnalyticsMetricsLRO(); + } + + public static void asyncExportAnalyticsMetricsLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) { + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("catalog555704345") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + OperationFuture future = + analyticsServiceClient.exportAnalyticsMetricsOperationCallable().futureCall(request); + // Do something. + ExportAnalyticsMetricsResponse response = future.get(); + } + } +} +// [END retail_v2beta_generated_AnalyticsService_ExportAnalyticsMetrics_LRO_async] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java new file mode 100644 index 000000000000..94122c082021 --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservice/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.samples; + +// [START retail_v2beta_generated_AnalyticsService_ExportAnalyticsMetrics_sync] +import com.google.cloud.retail.v2beta.AnalyticsServiceClient; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsRequest; +import com.google.cloud.retail.v2beta.ExportAnalyticsMetricsResponse; +import com.google.cloud.retail.v2beta.OutputConfig; + +public class SyncExportAnalyticsMetrics { + + public static void main(String[] args) throws Exception { + syncExportAnalyticsMetrics(); + } + + public static void syncExportAnalyticsMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (AnalyticsServiceClient analyticsServiceClient = AnalyticsServiceClient.create()) { + ExportAnalyticsMetricsRequest request = + ExportAnalyticsMetricsRequest.newBuilder() + .setCatalog("catalog555704345") + .setOutputConfig(OutputConfig.newBuilder().build()) + .setFilter("filter-1274492040") + .build(); + ExportAnalyticsMetricsResponse response = + analyticsServiceClient.exportAnalyticsMetricsAsync(request).get(); + } + } +} +// [END retail_v2beta_generated_AnalyticsService_ExportAnalyticsMetrics_sync] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservicesettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservicesettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java new file mode 100644 index 000000000000..865d278258aa --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/analyticsservicesettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.samples; + +// [START retail_v2beta_generated_AnalyticsServiceSettings_ExportAnalyticsMetrics_sync] +import com.google.cloud.retail.v2beta.AnalyticsServiceSettings; +import java.time.Duration; + +public class SyncExportAnalyticsMetrics { + + public static void main(String[] args) throws Exception { + syncExportAnalyticsMetrics(); + } + + public static void syncExportAnalyticsMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AnalyticsServiceSettings.Builder analyticsServiceSettingsBuilder = + AnalyticsServiceSettings.newBuilder(); + analyticsServiceSettingsBuilder + .exportAnalyticsMetricsSettings() + .setRetrySettings( + analyticsServiceSettingsBuilder + .exportAnalyticsMetricsSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AnalyticsServiceSettings analyticsServiceSettings = analyticsServiceSettingsBuilder.build(); + } +} +// [END retail_v2beta_generated_AnalyticsServiceSettings_ExportAnalyticsMetrics_sync] diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/stub/analyticsservicestubsettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/stub/analyticsservicestubsettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java new file mode 100644 index 000000000000..42c71614ac7e --- /dev/null +++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/stub/analyticsservicestubsettings/exportanalyticsmetrics/SyncExportAnalyticsMetrics.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.retail.v2beta.stub.samples; + +// [START retail_v2beta_generated_AnalyticsServiceStubSettings_ExportAnalyticsMetrics_sync] +import com.google.cloud.retail.v2beta.stub.AnalyticsServiceStubSettings; +import java.time.Duration; + +public class SyncExportAnalyticsMetrics { + + public static void main(String[] args) throws Exception { + syncExportAnalyticsMetrics(); + } + + public static void syncExportAnalyticsMetrics() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + AnalyticsServiceStubSettings.Builder analyticsServiceSettingsBuilder = + AnalyticsServiceStubSettings.newBuilder(); + analyticsServiceSettingsBuilder + .exportAnalyticsMetricsSettings() + .setRetrySettings( + analyticsServiceSettingsBuilder + .exportAnalyticsMetricsSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AnalyticsServiceStubSettings analyticsServiceSettings = analyticsServiceSettingsBuilder.build(); + } +} +// [END retail_v2beta_generated_AnalyticsServiceStubSettings_ExportAnalyticsMetrics_sync]