From 5f742f913f48c47c8ba3eeeb3e08adc162b288db Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 6 Sep 2022 20:32:16 +0000 Subject: [PATCH] feat: [retail] release Model Services to v2beta version (#8284) - [ ] Regenerate this pull request now. feat: release BatchRemoveCatalogAttributes API to v2beta version feat: release ExactSearchableOption for attribute config to v2beta version feat: release diversity_type for ServingConfig in v2beta version feat: add local inventories info to the Product resource feat: deprecate unused page_token field of PredictionRequest in v2beta version feat: deprecate unused facet_spec field of Control in v2beta version docs: improve documentation of SearchRequest for Search Personalization docs: improve documentation for Fullfillment and Inventory API in ProductService docs: minor documentation fixes and improvements PiperOrigin-RevId: 471846764 Source-Link: https://github.com/googleapis/googleapis/commit/15132940942b0c70083f9c7f6e0bf722fe620a8d Source-Link: https://github.com/googleapis/googleapis-gen/commit/c371ea8df2e34940875d51200cd57e300a2bc0a8 Copy-Tag: eyJwIjoiamF2YS1yZXRhaWwvLk93bEJvdC55YW1sIiwiaCI6ImMzNzFlYThkZjJlMzQ5NDA4NzVkNTEyMDBjZDU3ZTMwMGEyYmMwYTgifQ== --- .../retail/v2beta/CatalogServiceClient.java | 64 +- .../retail/v2beta/CatalogServiceSettings.java | 14 + .../v2beta/CompletionServiceClient.java | 24 +- .../retail/v2beta/ControlServiceClient.java | 20 +- .../retail/v2beta/ModelServiceClient.java | 1069 ++++ .../retail/v2beta/ModelServiceSettings.java | 294 + .../retail/v2beta/ProductServiceClient.java | 340 +- .../retail/v2beta/SearchServiceClient.java | 16 +- .../v2beta/ServingConfigServiceClient.java | 20 +- .../retail/v2beta/UserEventServiceClient.java | 42 +- .../cloud/retail/v2beta/gapic_metadata.json | 33 + .../cloud/retail/v2beta/package-info.java | 35 +- .../v2beta/stub/CatalogServiceStub.java | 8 + .../stub/CatalogServiceStubSettings.java | 34 + .../v2beta/stub/GrpcCatalogServiceStub.java | 45 + .../stub/GrpcModelServiceCallableFactory.java | 115 + .../v2beta/stub/GrpcModelServiceStub.java | 375 ++ .../stub/HttpJsonCatalogServiceStub.java | 66 + .../HttpJsonModelServiceCallableFactory.java | 105 + .../v2beta/stub/HttpJsonModelServiceStub.java | 563 ++ .../retail/v2beta/stub/ModelServiceStub.java | 104 + .../v2beta/stub/ModelServiceStubSettings.java | 618 ++ .../CatalogServiceClientHttpJsonTest.java | 57 + .../v2beta/CatalogServiceClientTest.java | 53 + .../ControlServiceClientHttpJsonTest.java | 7 + .../v2beta/ControlServiceClientTest.java | 5 + .../retail/v2beta/MockCatalogServiceImpl.java | 22 + .../cloud/retail/v2beta/MockModelService.java | 59 + .../retail/v2beta/MockModelServiceImpl.java | 203 + .../ModelServiceClientHttpJsonTest.java | 722 +++ .../retail/v2beta/ModelServiceClientTest.java | 637 ++ .../ProductServiceClientHttpJsonTest.java | 9 + .../v2beta/ProductServiceClientTest.java | 5 + ...ervingConfigServiceClientHttpJsonTest.java | 11 + .../ServingConfigServiceClientTest.java | 9 + .../retail/v2beta/CatalogServiceGrpc.java | 142 +- .../retail/v2beta/CompletionServiceGrpc.java | 26 +- .../retail/v2beta/ControlServiceGrpc.java | 20 +- .../cloud/retail/v2beta/ModelServiceGrpc.java | 1075 ++++ .../retail/v2beta/ProductServiceGrpc.java | 244 +- .../retail/v2beta/SearchServiceGrpc.java | 18 +- .../retail/v2beta/UserEventServiceGrpc.java | 80 +- .../retail/v2beta/AddControlRequest.java | 14 +- .../v2beta/AddControlRequestOrBuilder.java | 4 +- .../BatchRemoveCatalogAttributesRequest.java | 990 +++ ...moveCatalogAttributesRequestOrBuilder.java | 117 + .../BatchRemoveCatalogAttributesResponse.java | 1076 ++++ ...oveCatalogAttributesResponseOrBuilder.java | 139 + .../cloud/retail/v2beta/BigQuerySource.java | 81 +- .../v2beta/BigQuerySourceOrBuilder.java | 21 +- .../cloud/retail/v2beta/CatalogAttribute.java | 355 ++ .../v2beta/CatalogAttributeOrBuilder.java | 33 + .../cloud/retail/v2beta/CatalogProto.java | 128 +- .../retail/v2beta/CatalogServiceProto.java | 192 +- .../google/cloud/retail/v2beta/Condition.java | 36 +- .../google/cloud/retail/v2beta/Control.java | 881 ++- .../cloud/retail/v2beta/ControlOrBuilder.java | 200 +- .../cloud/retail/v2beta/ControlProto.java | 35 +- .../retail/v2beta/CreateModelMetadata.java | 652 ++ .../v2beta/CreateModelMetadataOrBuilder.java | 54 + .../retail/v2beta/CreateModelRequest.java | 1048 +++ .../v2beta/CreateModelRequestOrBuilder.java | 111 + .../cloud/retail/v2beta/CustomAttribute.java | 24 +- .../v2beta/CustomAttributeOrBuilder.java | 8 +- .../retail/v2beta/DeleteModelRequest.java | 666 ++ .../v2beta/DeleteModelRequestOrBuilder.java | 58 + .../v2beta/DeleteServingConfigRequest.java | 14 +- .../DeleteServingConfigRequestOrBuilder.java | 4 +- .../retail/v2beta/ExportConfigProto.java | 58 +- .../cloud/retail/v2beta/ExportMetadata.java | 4 +- .../google/cloud/retail/v2beta/GcsSource.java | 30 +- .../retail/v2beta/GcsSourceOrBuilder.java | 8 +- .../v2beta/GetCompletionConfigRequest.java | 14 +- .../GetCompletionConfigRequestOrBuilder.java | 4 +- .../retail/v2beta/GetControlRequest.java | 14 +- .../v2beta/GetControlRequestOrBuilder.java | 4 +- .../v2beta/GetServingConfigRequest.java | 14 +- .../GetServingConfigRequestOrBuilder.java | 4 +- .../v2beta/ImportCompletionDataRequest.java | 28 +- .../ImportCompletionDataRequestOrBuilder.java | 8 +- .../retail/v2beta/ImportErrorsConfig.java | 18 +- .../v2beta/ImportErrorsConfigOrBuilder.java | 6 +- .../cloud/retail/v2beta/ImportMetadata.java | 46 +- .../v2beta/ImportMetadataOrBuilder.java | 12 +- .../retail/v2beta/ImportProductsRequest.java | 176 +- .../ImportProductsRequestOrBuilder.java | 44 +- .../retail/v2beta/ListModelsRequest.java | 945 +++ .../v2beta/ListModelsRequestOrBuilder.java | 99 + .../retail/v2beta/ListModelsResponse.java | 1129 ++++ .../v2beta/ListModelsResponseOrBuilder.java | 101 + .../v2beta/ListServingConfigsRequest.java | 14 +- .../ListServingConfigsRequestOrBuilder.java | 4 +- .../retail/v2beta/MerchantCenterLink.java | 52 +- .../v2beta/MerchantCenterLinkOrBuilder.java | 16 +- .../com/google/cloud/retail/v2beta/Model.java | 5595 +++++++++++++++++ .../google/cloud/retail/v2beta/ModelName.java | 257 + .../cloud/retail/v2beta/ModelOrBuilder.java | 593 ++ .../cloud/retail/v2beta/ModelProto.java | 144 + .../retail/v2beta/ModelServiceProto.java | 280 + .../retail/v2beta/PauseModelRequest.java | 665 ++ .../v2beta/PauseModelRequestOrBuilder.java | 58 + .../cloud/retail/v2beta/PredictRequest.java | 81 +- .../v2beta/PredictRequestOrBuilder.java | 22 +- .../retail/v2beta/PredictionServiceProto.java | 79 +- .../google/cloud/retail/v2beta/Product.java | 737 ++- .../cloud/retail/v2beta/ProductOrBuilder.java | 108 +- .../cloud/retail/v2beta/ProductProto.java | 45 +- .../v2beta/RejoinUserEventsMetadata.java | 4 +- .../v2beta/RejoinUserEventsRequest.java | 36 +- .../RejoinUserEventsRequestOrBuilder.java | 8 +- .../v2beta/RejoinUserEventsResponse.java | 4 +- .../retail/v2beta/RemoveControlRequest.java | 14 +- .../v2beta/RemoveControlRequestOrBuilder.java | 4 +- .../retail/v2beta/ResumeModelRequest.java | 652 ++ .../v2beta/ResumeModelRequestOrBuilder.java | 54 + .../com/google/cloud/retail/v2beta/Rule.java | 10 +- .../cloud/retail/v2beta/SearchRequest.java | 178 +- .../retail/v2beta/SearchRequestOrBuilder.java | 36 +- .../cloud/retail/v2beta/SearchResponse.java | 480 ++ .../retail/v2beta/SearchServiceProto.java | 64 +- .../retail/v2beta/SearchSolutionUseCase.java | 4 +- .../cloud/retail/v2beta/ServingConfig.java | 1005 ++- .../retail/v2beta/ServingConfigOrBuilder.java | 166 +- .../retail/v2beta/ServingConfigProto.java | 37 +- .../retail/v2beta/TuneModelMetadata.java | 651 ++ .../v2beta/TuneModelMetadataOrBuilder.java | 54 + .../cloud/retail/v2beta/TuneModelRequest.java | 667 ++ .../v2beta/TuneModelRequestOrBuilder.java | 58 + .../retail/v2beta/TuneModelResponse.java | 457 ++ .../v2beta/TuneModelResponseOrBuilder.java | 24 + .../retail/v2beta/UpdateModelRequest.java | 1049 +++ .../v2beta/UpdateModelRequestOrBuilder.java | 107 + .../google/cloud/retail/v2beta/UserEvent.java | 26 +- .../retail/v2beta/UserEventOrBuilder.java | 8 +- .../retail/v2beta/UserEventServiceProto.java | 118 +- .../google/cloud/retail/v2beta/catalog.proto | 22 +- .../cloud/retail/v2beta/catalog_service.proto | 46 +- .../google/cloud/retail/v2beta/common.proto | 12 +- .../retail/v2beta/completion_service.proto | 6 +- .../google/cloud/retail/v2beta/control.proto | 38 +- .../cloud/retail/v2beta/control_service.proto | 7 +- .../cloud/retail/v2beta/export_config.proto | 4 +- .../cloud/retail/v2beta/import_config.proto | 54 +- .../google/cloud/retail/v2beta/model.proto | 238 + .../cloud/retail/v2beta/model_service.proto | 244 + .../retail/v2beta/prediction_service.proto | 13 +- .../google/cloud/retail/v2beta/product.proto | 15 +- .../cloud/retail/v2beta/product_service.proto | 71 +- .../cloud/retail/v2beta/search_service.proto | 54 +- .../cloud/retail/v2beta/serving_config.proto | 68 +- .../v2beta/serving_config_service.proto | 10 +- .../cloud/retail/v2beta/user_event.proto | 2 +- .../retail/v2beta/user_event_service.proto | 37 +- .../AsyncBatchRemoveCatalogAttributes.java | 50 + .../SyncBatchRemoveCatalogAttributes.java | 47 + .../SyncCreateSetCredentialsProvider.java | 41 + .../SyncCreateSetCredentialsProvider1.java | 40 + .../create/SyncCreateSetEndpoint.java | 38 + .../createmodel/AsyncCreateModel.java | 49 + .../createmodel/AsyncCreateModelLRO.java | 50 + .../createmodel/SyncCreateModel.java | 45 + .../SyncCreateModelCatalognameModel.java | 40 + .../SyncCreateModelStringModel.java | 40 + .../deletemodel/AsyncDeleteModel.java | 46 + .../deletemodel/SyncDeleteModel.java | 43 + .../deletemodel/SyncDeleteModelModelname.java | 39 + .../deletemodel/SyncDeleteModelString.java | 39 + .../listmodels/AsyncListModels.java | 50 + .../listmodels/AsyncListModelsPaged.java | 58 + .../listmodels/SyncListModels.java | 47 + .../listmodels/SyncListModelsCatalogname.java | 41 + .../listmodels/SyncListModelsString.java | 41 + .../pausemodel/AsyncPauseModel.java | 46 + .../pausemodel/SyncPauseModel.java | 43 + .../pausemodel/SyncPauseModelModelname.java | 39 + .../pausemodel/SyncPauseModelString.java | 39 + .../resumemodel/AsyncResumeModel.java | 42 + .../resumemodel/SyncResumeModel.java | 39 + .../resumemodel/SyncResumeModelString.java | 38 + .../tunemodel/AsyncTuneModel.java | 46 + .../tunemodel/AsyncTuneModelLRO.java | 48 + .../tunemodel/SyncTuneModel.java | 43 + .../tunemodel/SyncTuneModelModelname.java | 39 + .../tunemodel/SyncTuneModelString.java | 39 + .../updatemodel/AsyncUpdateModel.java | 47 + .../updatemodel/SyncUpdateModel.java | 44 + .../SyncUpdateModelModelFieldmask.java | 40 + .../pausemodel/SyncPauseModel.java | 45 + .../pausemodel/SyncPauseModel.java | 46 + 189 files changed, 32713 insertions(+), 1635 deletions(-) create mode 100644 java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ModelServiceClient.java create mode 100644 java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ModelServiceSettings.java create mode 100644 java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcModelServiceCallableFactory.java create mode 100644 java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcModelServiceStub.java create mode 100644 java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonModelServiceCallableFactory.java create mode 100644 java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonModelServiceStub.java create mode 100644 java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ModelServiceStub.java create mode 100644 java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ModelServiceStubSettings.java create mode 100644 java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockModelService.java create mode 100644 java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockModelServiceImpl.java create mode 100644 java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ModelServiceClientHttpJsonTest.java create mode 100644 java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ModelServiceClientTest.java create mode 100644 java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelServiceGrpc.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesRequest.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesRequestOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesResponse.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesResponseOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelMetadata.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelMetadataOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelRequest.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelRequestOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteModelRequest.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteModelRequestOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsRequest.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsRequestOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsResponse.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsResponseOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Model.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelName.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelProto.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelServiceProto.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PauseModelRequest.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PauseModelRequestOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ResumeModelRequest.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ResumeModelRequestOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelMetadata.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelMetadataOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelRequest.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelRequestOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelResponse.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelResponseOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateModelRequest.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateModelRequestOrBuilder.java create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/model.proto create mode 100644 java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/model_service.proto create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/catalogserviceclient/batchremovecatalogattributes/AsyncBatchRemoveCatalogAttributes.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/catalogserviceclient/batchremovecatalogattributes/SyncBatchRemoveCatalogAttributes.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetEndpoint.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/AsyncCreateModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/AsyncCreateModelLRO.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModelCatalognameModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModelStringModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/AsyncDeleteModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModelModelname.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModelString.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/AsyncListModels.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/AsyncListModelsPaged.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModels.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModelsCatalogname.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModelsString.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/AsyncPauseModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModelModelname.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModelString.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/AsyncResumeModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/SyncResumeModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/SyncResumeModelString.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/AsyncTuneModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/AsyncTuneModelLRO.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModelModelname.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModelString.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/AsyncUpdateModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/SyncUpdateModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/SyncUpdateModelModelFieldmask.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelservicesettings/pausemodel/SyncPauseModel.java create mode 100644 java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/stub/modelservicestubsettings/pausemodel/SyncPauseModel.java 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 f66631bb8b6e..61dda0c630ba 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 @@ -756,7 +756,7 @@ public final GetDefaultBranchResponse getDefaultBranch(GetDefaultBranchRequest r * } * * @param name Required. Full CompletionConfig resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final CompletionConfig getCompletionConfig(CompletionConfigName name) { @@ -783,7 +783,7 @@ public final CompletionConfig getCompletionConfig(CompletionConfigName name) { * } * * @param name Required. Full CompletionConfig resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final CompletionConfig getCompletionConfig(String name) { @@ -1280,6 +1280,66 @@ public final AttributesConfig removeCatalogAttribute(RemoveCatalogAttributeReque return stub.removeCatalogAttributeCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes all specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s from the + * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   BatchRemoveCatalogAttributesRequest request =
+   *       BatchRemoveCatalogAttributesRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .addAllAttributeKeys(new ArrayList())
+   *           .build();
+   *   BatchRemoveCatalogAttributesResponse response =
+   *       catalogServiceClient.batchRemoveCatalogAttributes(request);
+   * }
+   * }
+ * + * @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 BatchRemoveCatalogAttributesResponse batchRemoveCatalogAttributes( + BatchRemoveCatalogAttributesRequest request) { + return batchRemoveCatalogAttributesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Removes all specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s from the + * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig]. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+   *   BatchRemoveCatalogAttributesRequest request =
+   *       BatchRemoveCatalogAttributesRequest.newBuilder()
+   *           .setAttributesConfig(
+   *               AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .addAllAttributeKeys(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       catalogServiceClient.batchRemoveCatalogAttributesCallable().futureCall(request);
+   *   // Do something.
+   *   BatchRemoveCatalogAttributesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable< + BatchRemoveCatalogAttributesRequest, BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributesCallable() { + return stub.batchRemoveCatalogAttributesCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Replaces the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceSettings.java index 09c6f2b2e2a9..292407f99a59 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceSettings.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceSettings.java @@ -132,6 +132,13 @@ public UnaryCallSettings setDefaultBranchSetting return ((CatalogServiceStubSettings) getStubSettings()).removeCatalogAttributeSettings(); } + /** Returns the object with the settings used for calls to batchRemoveCatalogAttributes. */ + public UnaryCallSettings< + BatchRemoveCatalogAttributesRequest, BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributesSettings() { + return ((CatalogServiceStubSettings) getStubSettings()).batchRemoveCatalogAttributesSettings(); + } + /** Returns the object with the settings used for calls to replaceCatalogAttribute. */ public UnaryCallSettings replaceCatalogAttributeSettings() { @@ -312,6 +319,13 @@ public UnaryCallSettings.Builder setDefaultBranc return getStubSettingsBuilder().removeCatalogAttributeSettings(); } + /** Returns the builder for the settings used for calls to batchRemoveCatalogAttributes. */ + public UnaryCallSettings.Builder< + BatchRemoveCatalogAttributesRequest, BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributesSettings() { + return getStubSettingsBuilder().batchRemoveCatalogAttributesSettings(); + } + /** Returns the builder for the settings used for calls to replaceCatalogAttribute. */ public UnaryCallSettings.Builder replaceCatalogAttributeSettings() { 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 8f1bca205f4c..ce0ebe6de26c 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 @@ -33,8 +33,8 @@ /** * Service Description: Auto-completion service for retail. * - *

This feature is only available for users who have Retail Search enabled. Please enable Retail - * Search on Cloud Console before using this feature. + *

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

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: @@ -205,8 +205,8 @@ public final OperationsClient getHttpJsonOperationsClient() { /** * Completes the specified prefix with keyword suggestions. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

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

Sample code: * @@ -239,8 +239,8 @@ public final CompleteQueryResponse completeQuery(CompleteQueryRequest request) { /** * Completes the specified prefix with keyword suggestions. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

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

Sample code: * @@ -278,8 +278,8 @@ public final UnaryCallable complete *

The operation is successfully finished only after the imported suggestions are indexed * successfully and ready for serving. The process takes hours. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

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

Sample code: * @@ -315,8 +315,8 @@ public final UnaryCallable complete *

The operation is successfully finished only after the imported suggestions are indexed * successfully and ready for serving. The process takes hours. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

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

Sample code: * @@ -352,8 +352,8 @@ public final UnaryCallable complete *

The operation is successfully finished only after the imported suggestions are indexed * successfully and ready for serving. The process takes hours. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

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

Sample 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 e5f274225bbc..9b31bc1ac109 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 @@ -421,7 +421,7 @@ public final UnaryCallable deleteControlCallable() * *

[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 - * delete does not exist, a NOT_FOUND error is returned. + * update does not exist, a NOT_FOUND error is returned. * *

Sample code: * @@ -456,7 +456,7 @@ public final Control updateControl(Control control, FieldMask updateMask) { * *

[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 - * delete does not exist, a NOT_FOUND error is returned. + * update does not exist, a NOT_FOUND error is returned. * *

Sample code: * @@ -486,7 +486,7 @@ public final Control updateControl(UpdateControlRequest request) { * *

[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 - * delete does not exist, a NOT_FOUND error is returned. + * update does not exist, a NOT_FOUND error is returned. * *

Sample code: * @@ -524,7 +524,7 @@ public final UnaryCallable updateControlCallable( * } * } * - * @param name Required. The resource name of the Control to delete. Format: + * @param name Required. The resource name of the Control to get. Format: * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -549,7 +549,7 @@ public final Control getControl(ControlName name) { * } * } * - * @param name Required. The resource name of the Control to delete. Format: + * @param name Required. The resource name of the Control to get. Format: * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -611,7 +611,7 @@ public final UnaryCallable getControlCallable() { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all Controls linked to this catalog. + * Lists all Controls by their parent [Catalog][google.cloud.retail.v2beta.Catalog]. * *

Sample code: * @@ -640,7 +640,7 @@ public final ListControlsPagedResponse listControls(CatalogName parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all Controls linked to this catalog. + * Lists all Controls by their parent [Catalog][google.cloud.retail.v2beta.Catalog]. * *

Sample code: * @@ -666,7 +666,7 @@ public final ListControlsPagedResponse listControls(String parent) { // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all Controls linked to this catalog. + * Lists all Controls by their parent [Catalog][google.cloud.retail.v2beta.Catalog]. * *

Sample code: * @@ -696,7 +696,7 @@ public final ListControlsPagedResponse listControls(ListControlsRequest request) // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all Controls linked to this catalog. + * Lists all Controls by their parent [Catalog][google.cloud.retail.v2beta.Catalog]. * *

Sample code: * @@ -727,7 +727,7 @@ public final ListControlsPagedResponse listControls(ListControlsRequest request) // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Lists all Controls linked to this catalog. + * Lists all Controls by their parent [Catalog][google.cloud.retail.v2beta.Catalog]. * *

Sample 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 new file mode 100644 index 000000000000..fa064dbf2768 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ModelServiceClient.java @@ -0,0 +1,1069 @@ +/* + * Copyright 2022 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.ApiFuture; +import com.google.api.core.ApiFutures; +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.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.stub.ModelServiceStub; +import com.google.cloud.retail.v2beta.stub.ModelServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service for performing CRUD operations on models. Recommendation models + * contain all the metadata necessary to generate a set of models for the `Predict()` API. A model + * is queried indirectly via a ServingConfig, which associates a model with a given Placement (e.g. + * Frequently Bought Together on Home Page). + * + *

This service allows you to do the following: + * + *

    + *
  • Initiate training of a model. + *
  • Pause training of an existing model. + *
  • List all the available models along with their metadata. + *
  • Control their tuning schedule. + *
+ * + *

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 for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
+ *   Model response = modelServiceClient.pauseModel(name);
+ * }
+ * }
+ * + *

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

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

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 ModelServiceSettings to + * create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ModelServiceSettings modelServiceSettings =
+ *     ModelServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ModelServiceSettings modelServiceSettings =
+ *     ModelServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings);
+ * }
+ * + *

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 for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ModelServiceSettings modelServiceSettings =
+ *     ModelServiceSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             ModelServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ModelServiceClient implements BackgroundResource { + private final ModelServiceSettings settings; + private final ModelServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of ModelServiceClient with default settings. */ + public static final ModelServiceClient create() throws IOException { + return create(ModelServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ModelServiceClient, 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 ModelServiceClient create(ModelServiceSettings settings) throws IOException { + return new ModelServiceClient(settings); + } + + /** + * Constructs an instance of ModelServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(ModelServiceSettings). + */ + public static final ModelServiceClient create(ModelServiceStub stub) { + return new ModelServiceClient(stub); + } + + /** + * Constructs an instance of ModelServiceClient, 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 ModelServiceClient(ModelServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ModelServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected ModelServiceClient(ModelServiceStub 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 ModelServiceSettings getSettings() { + return settings; + } + + public ModelServiceStub 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. + /** + * Creates a new model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   Model model = Model.newBuilder().build();
+   *   Model response = modelServiceClient.createModelAsync(parent, model).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource under which to create the model. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * @param model Required. The payload of the [Model][google.cloud.retail.v2beta.Model] to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createModelAsync( + CatalogName parent, Model model) { + CreateModelRequest request = + CreateModelRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setModel(model) + .build(); + return createModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   Model model = Model.newBuilder().build();
+   *   Model response = modelServiceClient.createModelAsync(parent, model).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource under which to create the model. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * @param model Required. The payload of the [Model][google.cloud.retail.v2beta.Model] to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createModelAsync( + String parent, Model model) { + CreateModelRequest request = + CreateModelRequest.newBuilder().setParent(parent).setModel(model).build(); + return createModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   CreateModelRequest request =
+   *       CreateModelRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setModel(Model.newBuilder().build())
+   *           .setDryRun(true)
+   *           .build();
+   *   Model response = modelServiceClient.createModelAsync(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 createModelAsync( + CreateModelRequest request) { + return createModelOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   CreateModelRequest request =
+   *       CreateModelRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setModel(Model.newBuilder().build())
+   *           .setDryRun(true)
+   *           .build();
+   *   OperationFuture future =
+   *       modelServiceClient.createModelOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Model response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createModelOperationCallable() { + return stub.createModelOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   CreateModelRequest request =
+   *       CreateModelRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setModel(Model.newBuilder().build())
+   *           .setDryRun(true)
+   *           .build();
+   *   ApiFuture future = modelServiceClient.createModelCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createModelCallable() { + return stub.createModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pauses the training of an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
+   *   Model response = modelServiceClient.pauseModel(name);
+   * }
+   * }
+ * + * @param name Required. The name of the model to pause. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Model pauseModel(ModelName name) { + PauseModelRequest request = + PauseModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return pauseModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pauses the training of an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   String name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString();
+   *   Model response = modelServiceClient.pauseModel(name);
+   * }
+   * }
+ * + * @param name Required. The name of the model to pause. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Model pauseModel(String name) { + PauseModelRequest request = PauseModelRequest.newBuilder().setName(name).build(); + return pauseModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pauses the training of an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   PauseModelRequest request =
+   *       PauseModelRequest.newBuilder()
+   *           .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+   *           .build();
+   *   Model response = modelServiceClient.pauseModel(request);
+   * }
+   * }
+ * + * @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 Model pauseModel(PauseModelRequest request) { + return pauseModelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Pauses the training of an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   PauseModelRequest request =
+   *       PauseModelRequest.newBuilder()
+   *           .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+   *           .build();
+   *   ApiFuture future = modelServiceClient.pauseModelCallable().futureCall(request);
+   *   // Do something.
+   *   Model response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable pauseModelCallable() { + return stub.pauseModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resumes the training of an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   String name = "name3373707";
+   *   Model response = modelServiceClient.resumeModel(name);
+   * }
+   * }
+ * + * @param name Required. The name of the model to resume. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Model resumeModel(String name) { + ResumeModelRequest request = ResumeModelRequest.newBuilder().setName(name).build(); + return resumeModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resumes the training of an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   ResumeModelRequest request = ResumeModelRequest.newBuilder().setName("name3373707").build();
+   *   Model response = modelServiceClient.resumeModel(request);
+   * }
+   * }
+ * + * @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 Model resumeModel(ResumeModelRequest request) { + return resumeModelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Resumes the training of an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   ResumeModelRequest request = ResumeModelRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = modelServiceClient.resumeModelCallable().futureCall(request);
+   *   // Do something.
+   *   Model response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable resumeModelCallable() { + return stub.resumeModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
+   *   modelServiceClient.deleteModel(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the [Model][google.cloud.retail.v2beta.Model] to + * delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteModel(ModelName name) { + DeleteModelRequest request = + DeleteModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   String name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString();
+   *   modelServiceClient.deleteModel(name);
+   * }
+   * }
+ * + * @param name Required. The resource name of the [Model][google.cloud.retail.v2beta.Model] to + * delete. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteModel(String name) { + DeleteModelRequest request = DeleteModelRequest.newBuilder().setName(name).build(); + deleteModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   DeleteModelRequest request =
+   *       DeleteModelRequest.newBuilder()
+   *           .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+   *           .build();
+   *   modelServiceClient.deleteModel(request);
+   * }
+   * }
+ * + * @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 void deleteModel(DeleteModelRequest request) { + deleteModelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   DeleteModelRequest request =
+   *       DeleteModelRequest.newBuilder()
+   *           .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+   *           .build();
+   *   ApiFuture future = modelServiceClient.deleteModelCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteModelCallable() { + return stub.deleteModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the models linked to this event store. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+   *   for (Model element : modelServiceClient.listModels(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent for which to list models. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListModelsPagedResponse listModels(CatalogName parent) { + ListModelsRequest request = + ListModelsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listModels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the models linked to this event store. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+   *   for (Model element : modelServiceClient.listModels(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent for which to list models. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListModelsPagedResponse listModels(String parent) { + ListModelsRequest request = ListModelsRequest.newBuilder().setParent(parent).build(); + return listModels(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the models linked to this event store. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   ListModelsRequest request =
+   *       ListModelsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Model element : modelServiceClient.listModels(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @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 ListModelsPagedResponse listModels(ListModelsRequest request) { + return listModelsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the models linked to this event store. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   ListModelsRequest request =
+   *       ListModelsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = modelServiceClient.listModelsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Model element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listModelsPagedCallable() { + return stub.listModelsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists all the models linked to this event store. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   ListModelsRequest request =
+   *       ListModelsRequest.newBuilder()
+   *           .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListModelsResponse response = modelServiceClient.listModelsCallable().call(request);
+   *     for (Model element : response.getModelsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listModelsCallable() { + return stub.listModelsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   Model model = Model.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Model response = modelServiceClient.updateModel(model, updateMask);
+   * }
+   * }
+ * + * @param model Required. The body of the updated [Model][google.cloud.retail.v2beta.Model]. + * @param updateMask Optional. Indicates which fields in the provided 'model' to update. If not + * set, by default updates all fields. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Model updateModel(Model model, FieldMask updateMask) { + UpdateModelRequest request = + UpdateModelRequest.newBuilder().setModel(model).setUpdateMask(updateMask).build(); + return updateModel(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   UpdateModelRequest request =
+   *       UpdateModelRequest.newBuilder()
+   *           .setModel(Model.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Model response = modelServiceClient.updateModel(request);
+   * }
+   * }
+ * + * @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 Model updateModel(UpdateModelRequest request) { + return updateModelCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * 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. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   UpdateModelRequest request =
+   *       UpdateModelRequest.newBuilder()
+   *           .setModel(Model.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = modelServiceClient.updateModelCallable().futureCall(request);
+   *   // Do something.
+   *   Model response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateModelCallable() { + return stub.updateModelCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Tunes an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
+   *   TuneModelResponse response = modelServiceClient.tuneModelAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the model to tune. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture tuneModelAsync( + ModelName name) { + TuneModelRequest request = + TuneModelRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return tuneModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Tunes an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   String name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString();
+   *   TuneModelResponse response = modelServiceClient.tuneModelAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The resource name of the model to tune. Format: + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture tuneModelAsync(String name) { + TuneModelRequest request = TuneModelRequest.newBuilder().setName(name).build(); + return tuneModelAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Tunes an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   TuneModelRequest request =
+   *       TuneModelRequest.newBuilder()
+   *           .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+   *           .build();
+   *   TuneModelResponse response = modelServiceClient.tuneModelAsync(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 tuneModelAsync( + TuneModelRequest request) { + return tuneModelOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Tunes an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   TuneModelRequest request =
+   *       TuneModelRequest.newBuilder()
+   *           .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+   *           .build();
+   *   OperationFuture future =
+   *       modelServiceClient.tuneModelOperationCallable().futureCall(request);
+   *   // Do something.
+   *   TuneModelResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + tuneModelOperationCallable() { + return stub.tuneModelOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Tunes an existing model. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+   *   TuneModelRequest request =
+   *       TuneModelRequest.newBuilder()
+   *           .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+   *           .build();
+   *   ApiFuture future = modelServiceClient.tuneModelCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable tuneModelCallable() { + return stub.tuneModelCallable(); + } + + @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); + } + + public static class ListModelsPagedResponse + extends AbstractPagedListResponse< + ListModelsRequest, + ListModelsResponse, + Model, + ListModelsPage, + ListModelsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListModelsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, input -> new ListModelsPagedResponse(input), MoreExecutors.directExecutor()); + } + + private ListModelsPagedResponse(ListModelsPage page) { + super(page, ListModelsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListModelsPage + extends AbstractPage { + + private ListModelsPage( + PageContext context, + ListModelsResponse response) { + super(context, response); + } + + private static ListModelsPage createEmptyPage() { + return new ListModelsPage(null, null); + } + + @Override + protected ListModelsPage createPage( + PageContext context, + ListModelsResponse response) { + return new ListModelsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListModelsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListModelsRequest, + ListModelsResponse, + Model, + ListModelsPage, + ListModelsFixedSizeCollection> { + + private ListModelsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListModelsFixedSizeCollection createEmptyCollection() { + return new ListModelsFixedSizeCollection(null, 0); + } + + @Override + protected ListModelsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListModelsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ModelServiceSettings.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ModelServiceSettings.java new file mode 100644 index 000000000000..7d4faa16f255 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/ModelServiceSettings.java @@ -0,0 +1,294 @@ +/* + * Copyright 2022 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 com.google.cloud.retail.v2beta.ModelServiceClient.ListModelsPagedResponse; + +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.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.retail.v2beta.stub.ModelServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 ModelServiceClient}. + * + *

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 pauseModel to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ModelServiceSettings.Builder modelServiceSettingsBuilder = ModelServiceSettings.newBuilder();
+ * modelServiceSettingsBuilder
+ *     .pauseModelSettings()
+ *     .setRetrySettings(
+ *         modelServiceSettingsBuilder
+ *             .pauseModelSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ModelServiceSettings modelServiceSettings = modelServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ModelServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to createModel. */ + public UnaryCallSettings createModelSettings() { + return ((ModelServiceStubSettings) getStubSettings()).createModelSettings(); + } + + /** Returns the object with the settings used for calls to createModel. */ + public OperationCallSettings + createModelOperationSettings() { + return ((ModelServiceStubSettings) getStubSettings()).createModelOperationSettings(); + } + + /** Returns the object with the settings used for calls to pauseModel. */ + public UnaryCallSettings pauseModelSettings() { + return ((ModelServiceStubSettings) getStubSettings()).pauseModelSettings(); + } + + /** Returns the object with the settings used for calls to resumeModel. */ + public UnaryCallSettings resumeModelSettings() { + return ((ModelServiceStubSettings) getStubSettings()).resumeModelSettings(); + } + + /** Returns the object with the settings used for calls to deleteModel. */ + public UnaryCallSettings deleteModelSettings() { + return ((ModelServiceStubSettings) getStubSettings()).deleteModelSettings(); + } + + /** Returns the object with the settings used for calls to listModels. */ + public PagedCallSettings + listModelsSettings() { + return ((ModelServiceStubSettings) getStubSettings()).listModelsSettings(); + } + + /** Returns the object with the settings used for calls to updateModel. */ + public UnaryCallSettings updateModelSettings() { + return ((ModelServiceStubSettings) getStubSettings()).updateModelSettings(); + } + + /** Returns the object with the settings used for calls to tuneModel. */ + public UnaryCallSettings tuneModelSettings() { + return ((ModelServiceStubSettings) getStubSettings()).tuneModelSettings(); + } + + /** Returns the object with the settings used for calls to tuneModel. */ + public OperationCallSettings + tuneModelOperationSettings() { + return ((ModelServiceStubSettings) getStubSettings()).tuneModelOperationSettings(); + } + + public static final ModelServiceSettings create(ModelServiceStubSettings stub) + throws IOException { + return new ModelServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ModelServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ModelServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ModelServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ModelServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ModelServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return ModelServiceStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ModelServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ModelServiceStubSettings.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 ModelServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ModelServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(ModelServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(ModelServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ModelServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(ModelServiceStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(ModelServiceStubSettings.newHttpJsonBuilder()); + } + + public ModelServiceStubSettings.Builder getStubSettingsBuilder() { + return ((ModelServiceStubSettings.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 createModel. */ + public UnaryCallSettings.Builder createModelSettings() { + return getStubSettingsBuilder().createModelSettings(); + } + + /** Returns the builder for the settings used for calls to createModel. */ + public OperationCallSettings.Builder + createModelOperationSettings() { + return getStubSettingsBuilder().createModelOperationSettings(); + } + + /** Returns the builder for the settings used for calls to pauseModel. */ + public UnaryCallSettings.Builder pauseModelSettings() { + return getStubSettingsBuilder().pauseModelSettings(); + } + + /** Returns the builder for the settings used for calls to resumeModel. */ + public UnaryCallSettings.Builder resumeModelSettings() { + return getStubSettingsBuilder().resumeModelSettings(); + } + + /** Returns the builder for the settings used for calls to deleteModel. */ + public UnaryCallSettings.Builder deleteModelSettings() { + return getStubSettingsBuilder().deleteModelSettings(); + } + + /** Returns the builder for the settings used for calls to listModels. */ + public PagedCallSettings.Builder + listModelsSettings() { + return getStubSettingsBuilder().listModelsSettings(); + } + + /** Returns the builder for the settings used for calls to updateModel. */ + public UnaryCallSettings.Builder updateModelSettings() { + return getStubSettingsBuilder().updateModelSettings(); + } + + /** Returns the builder for the settings used for calls to tuneModel. */ + public UnaryCallSettings.Builder tuneModelSettings() { + return getStubSettingsBuilder().tuneModelSettings(); + } + + /** Returns the builder for the settings used for calls to tuneModel. */ + public OperationCallSettings.Builder + tuneModelOperationSettings() { + return getStubSettingsBuilder().tuneModelOperationSettings(); + } + + @Override + public ModelServiceSettings build() throws IOException { + return new ModelServiceSettings(this); + } + } +} 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 585162e4b8c0..25147d9929b0 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 @@ -966,8 +966,8 @@ public final UnaryCallable importProductsCalla * *

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, updates are not immediately manifested in the + * 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]. @@ -975,20 +975,20 @@ public final UnaryCallable importProductsCalla *

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) will overwrite any existing value(s) while ignoring the last - * update time for this field. Furthermore, the last update time for the specified inventory - * fields will be overwritten to the time of 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. * *

If no inventory fields are set in * [CreateProductRequest.product][google.cloud.retail.v2beta.CreateProductRequest.product], then - * any pre-existing inventory information for this product will be used. + * any pre-existing inventory information for this product is used. * *

If no inventory fields are set in * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask], then - * any existing inventory information will be preserved. + * any existing inventory information is preserved. * *

Pre-existing inventory information can only be updated with * [ProductService.SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], @@ -996,8 +996,15 @@ public final UnaryCallable importProductsCalla * and * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the + * [GetOperation][google.longrunning.Operations.GetOperation] API returns `NOT_FOUND` afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates are not marked as [done][google.longrunning.Operation.done] until they + * are obsolete. + * + *

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

Sample code: * @@ -1083,8 +1090,8 @@ public final OperationFuture setInve * *

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, updates are not immediately manifested in the + * 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]. @@ -1092,20 +1099,20 @@ public final OperationFuture setInve *

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) will overwrite any existing value(s) while ignoring the last - * update time for this field. Furthermore, the last update time for the specified inventory - * fields will be overwritten to the time of 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. * *

If no inventory fields are set in * [CreateProductRequest.product][google.cloud.retail.v2beta.CreateProductRequest.product], then - * any pre-existing inventory information for this product will be used. + * any pre-existing inventory information for this product is used. * *

If no inventory fields are set in * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask], then - * any existing inventory information will be preserved. + * any existing inventory information is preserved. * *

Pre-existing inventory information can only be updated with * [ProductService.SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], @@ -1113,8 +1120,15 @@ public final OperationFuture setInve * and * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the + * [GetOperation][google.longrunning.Operations.GetOperation] API returns `NOT_FOUND` afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates are not marked as [done][google.longrunning.Operation.done] until they + * are obsolete. + * + *

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

Sample code: * @@ -1148,8 +1162,8 @@ public final OperationFuture setInve * *

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, updates are not immediately manifested in the + * 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]. @@ -1157,20 +1171,20 @@ public final OperationFuture setInve *

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) will overwrite any existing value(s) while ignoring the last - * update time for this field. Furthermore, the last update time for the specified inventory - * fields will be overwritten to the time of 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. * *

If no inventory fields are set in * [CreateProductRequest.product][google.cloud.retail.v2beta.CreateProductRequest.product], then - * any pre-existing inventory information for this product will be used. + * any pre-existing inventory information for this product is used. * *

If no inventory fields are set in * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask], then - * any existing inventory information will be preserved. + * any existing inventory information is preserved. * *

Pre-existing inventory information can only be updated with * [ProductService.SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], @@ -1178,8 +1192,15 @@ public final OperationFuture setInve * and * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the + * [GetOperation][google.longrunning.Operations.GetOperation] API returns `NOT_FOUND` afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates are not marked as [done][google.longrunning.Operation.done] until they + * are obsolete. + * + *

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

Sample code: * @@ -1213,8 +1234,8 @@ public final OperationFuture setInve * *

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, updates are not immediately manifested in the + * 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]. @@ -1222,20 +1243,20 @@ public final OperationFuture setInve *

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) will overwrite any existing value(s) while ignoring the last - * update time for this field. Furthermore, the last update time for the specified inventory - * fields will be overwritten to the time of 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. * *

If no inventory fields are set in * [CreateProductRequest.product][google.cloud.retail.v2beta.CreateProductRequest.product], then - * any pre-existing inventory information for this product will be used. + * any pre-existing inventory information for this product is used. * *

If no inventory fields are set in * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask], then - * any existing inventory information will be preserved. + * any existing inventory information is preserved. * *

Pre-existing inventory information can only be updated with * [ProductService.SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], @@ -1243,8 +1264,15 @@ public final OperationFuture setInve * and * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the + * [GetOperation][google.longrunning.Operations.GetOperation] API returns `NOT_FOUND` afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates are not marked as [done][google.longrunning.Operation.done] until they + * are obsolete. + * + *

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

Sample code: * @@ -1282,8 +1310,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1328,8 +1364,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1373,8 +1417,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1418,8 +1470,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1463,8 +1523,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1507,8 +1575,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1553,8 +1629,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1598,8 +1682,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1643,8 +1735,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1690,8 +1790,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1739,8 +1847,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no * effect on local inventories. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1790,8 +1906,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no * effect on local inventories. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1840,8 +1964,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no * effect on local inventories. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1890,8 +2022,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no * effect on local inventories. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1940,8 +2080,16 @@ public final UnaryCallable setInventoryCallable( * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no * effect on local inventories. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -1986,8 +2134,16 @@ public final UnaryCallable addLocalInvent * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no * effect on local inventories. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -2035,8 +2191,16 @@ public final UnaryCallable addLocalInvent * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no * effect on local inventories. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -2083,8 +2247,16 @@ public final UnaryCallable addLocalInvent * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no * effect on local inventories. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -2130,8 +2302,16 @@ public final UnaryCallable addLocalInvent * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no * effect on local inventories. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample code: * @@ -2179,8 +2359,16 @@ public final UnaryCallable addLocalInvent * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] has no * effect on local inventories. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and + * [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND + * afterwards. + * + *

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated + * with the stale updates will not be marked as [done][google.longrunning.Operation.done] until + * being obsolete. + * + *

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

Sample 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 2fc1ffd695cf..357269726e1c 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 @@ -37,8 +37,8 @@ /** * Service Description: Service for search. * - *

This feature is only available for users who have Retail Search enabled. Please enable Retail - * Search on Cloud Console before using this feature. + *

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

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: @@ -196,8 +196,8 @@ public SearchServiceStub getStub() { /** * Performs a search. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

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

Sample code: * @@ -246,8 +246,8 @@ public final SearchPagedResponse search(SearchRequest request) { /** * Performs a search. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

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

Sample code: * @@ -296,8 +296,8 @@ public final UnaryCallable searchPagedCallab /** * Performs a search. * - *

This feature is only available for users who have Retail Search enabled. Please enable - * Retail Search on Cloud Console before using this feature. + *

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

Sample 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 c9ed82ae0f64..0a62d58f511b 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 @@ -343,7 +343,7 @@ public final ServingConfig createServingConfig(CreateServingConfigRequest reques * } * * @param name Required. The resource name of the ServingConfig to delete. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteServingConfig(ServingConfigName name) { @@ -375,7 +375,7 @@ public final void deleteServingConfig(ServingConfigName name) { * } * * @param name Required. The resource name of the ServingConfig to delete. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteServingConfig(String name) { @@ -557,7 +557,7 @@ public final ServingConfig updateServingConfig(UpdateServingConfigRequest reques * } * * @param name Required. The resource name of the ServingConfig to get. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ServingConfig getServingConfig(ServingConfigName name) { @@ -587,7 +587,7 @@ public final ServingConfig getServingConfig(ServingConfigName name) { * } * * @param name Required. The resource name of the ServingConfig to get. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ServingConfig getServingConfig(String name) { @@ -675,7 +675,7 @@ public final UnaryCallable getServingCon * } * * @param parent Required. The catalog resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListServingConfigsPagedResponse listServingConfigs(CatalogName parent) { @@ -706,7 +706,7 @@ public final ListServingConfigsPagedResponse listServingConfigs(CatalogName pare * } * * @param parent Required. The catalog resource name. Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListServingConfigsPagedResponse listServingConfigs(String parent) { @@ -838,7 +838,7 @@ public final ListServingConfigsPagedResponse listServingConfigs( * } * * @param servingConfig Required. The source ServingConfig resource name . Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ServingConfig addControl(ServingConfigName servingConfig) { @@ -872,7 +872,7 @@ public final ServingConfig addControl(ServingConfigName servingConfig) { * } * * @param servingConfig Required. The source ServingConfig resource name . Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ServingConfig addControl(String servingConfig) { @@ -966,7 +966,7 @@ public final UnaryCallable addControlCallable( * } * * @param servingConfig Required. The source ServingConfig resource name . Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ServingConfig removeControl(ServingConfigName servingConfig) { @@ -997,7 +997,7 @@ public final ServingConfig removeControl(ServingConfigName servingConfig) { * } * * @param servingConfig Required. The source ServingConfig resource name . Format: - * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id} + * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}` * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ServingConfig removeControl(String servingConfig) { 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 317ccaf75355..c4c4e76db7da 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 @@ -404,8 +404,8 @@ public final UnaryCallable purgeUserEventsCal * 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. + *

`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`. * *

Sample code: * @@ -437,8 +437,8 @@ public final OperationFuture importUse * 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. + *

`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`. * *

Sample code: * @@ -469,8 +469,8 @@ public final OperationFuture importUse * 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. + *

`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`. * *

Sample code: * @@ -497,11 +497,11 @@ public final UnaryCallable importUserEventsC // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Starts a user event rejoin operation with latest product catalog. Events will not be annotated - * with detailed product information if product is missing from the catalog at the time the user - * event is ingested, and these events are stored as unjoined events with a limited usage on - * training and serving. This method can be used to start a join operation on specified events - * with latest version of product catalog. It can also be used to correct events joined with the + * 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. * *

Sample code: @@ -527,11 +527,11 @@ public final UnaryCallable importUserEventsC // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Starts a user event rejoin operation with latest product catalog. Events will not be annotated - * with detailed product information if product is missing from the catalog at the time the user - * event is ingested, and these events are stored as unjoined events with a limited usage on - * training and serving. This method can be used to start a join operation on specified events - * with latest version of product catalog. It can also be used to correct events joined with the + * 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. * *

Sample code: @@ -557,11 +557,11 @@ public final UnaryCallable importUserEventsC // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Starts a user event rejoin operation with latest product catalog. Events will not be annotated - * with detailed product information if product is missing from the catalog at the time the user - * event is ingested, and these events are stored as unjoined events with a limited usage on - * training and serving. This method can be used to start a join operation on specified events - * with latest version of product catalog. It can also be used to correct events joined with the + * 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. * *

Sample 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 e5e1a2552016..33d1590fae58 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 @@ -13,6 +13,9 @@ "AddCatalogAttribute": { "methods": ["addCatalogAttribute", "addCatalogAttributeCallable"] }, + "BatchRemoveCatalogAttributes": { + "methods": ["batchRemoveCatalogAttributes", "batchRemoveCatalogAttributesCallable"] + }, "GetAttributesConfig": { "methods": ["getAttributesConfig", "getAttributesConfig", "getAttributesConfig", "getAttributesConfigCallable"] }, @@ -86,6 +89,36 @@ } } }, + "ModelService": { + "clients": { + "grpc": { + "libraryClient": "ModelServiceClient", + "rpcs": { + "CreateModel": { + "methods": ["createModelAsync", "createModelAsync", "createModelAsync", "createModelOperationCallable", "createModelCallable"] + }, + "DeleteModel": { + "methods": ["deleteModel", "deleteModel", "deleteModel", "deleteModelCallable"] + }, + "ListModels": { + "methods": ["listModels", "listModels", "listModels", "listModelsPagedCallable", "listModelsCallable"] + }, + "PauseModel": { + "methods": ["pauseModel", "pauseModel", "pauseModel", "pauseModelCallable"] + }, + "ResumeModel": { + "methods": ["resumeModel", "resumeModel", "resumeModelCallable"] + }, + "TuneModel": { + "methods": ["tuneModelAsync", "tuneModelAsync", "tuneModelAsync", "tuneModelOperationCallable", "tuneModelCallable"] + }, + "UpdateModel": { + "methods": ["updateModel", "updateModel", "updateModelCallable"] + } + } + } + } + }, "PredictionService": { "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 a28b696189c2..df6716a51db6 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 @@ -39,8 +39,8 @@ * *

Service Description: Auto-completion service for retail. * - *

This feature is only available for users who have Retail Search enabled. Please enable Retail - * Search on Cloud Console before using this feature. + *

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

Sample for CompletionServiceClient: * @@ -79,6 +79,33 @@ * } * } * + *

======================= ModelServiceClient ======================= + * + *

Service Description: Service for performing CRUD operations on models. Recommendation models + * contain all the metadata necessary to generate a set of models for the `Predict()` API. A model + * is queried indirectly via a ServingConfig, which associates a model with a given Placement (e.g. + * Frequently Bought Together on Home Page). + * + *

This service allows you to do the following: + * + *

    + *
  • Initiate training of a model. + *
  • Pause training of an existing model. + *
  • List all the available models along with their metadata. + *
  • Control their tuning schedule. + *
+ * + *

Sample for ModelServiceClient: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+ *   ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
+ *   Model response = modelServiceClient.pauseModel(name);
+ * }
+ * }
+ * *

======================= PredictionServiceClient ======================= * *

Service Description: Service for making recommendation prediction. @@ -126,8 +153,8 @@ * *

Service Description: Service for search. * - *

This feature is only available for users who have Retail Search enabled. Please enable Retail - * Search on Cloud Console before using this feature. + *

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

Sample for SearchServiceClient: * diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStub.java index dc42b194082b..31438aaf6ad0 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStub.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/CatalogServiceStub.java @@ -23,6 +23,8 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.retail.v2beta.AddCatalogAttributeRequest; import com.google.cloud.retail.v2beta.AttributesConfig; +import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest; +import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse; import com.google.cloud.retail.v2beta.Catalog; import com.google.cloud.retail.v2beta.CompletionConfig; import com.google.cloud.retail.v2beta.GetAttributesConfigRequest; @@ -98,6 +100,12 @@ public UnaryCallable addCatalogAtt throw new UnsupportedOperationException("Not implemented: removeCatalogAttributeCallable()"); } + public UnaryCallable + batchRemoveCatalogAttributesCallable() { + throw new UnsupportedOperationException( + "Not implemented: batchRemoveCatalogAttributesCallable()"); + } + public UnaryCallable replaceCatalogAttributeCallable() { throw new UnsupportedOperationException("Not implemented: replaceCatalogAttributeCallable()"); 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 ea6b765d5acf..efafef10ec21 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 @@ -45,6 +45,8 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.retail.v2beta.AddCatalogAttributeRequest; import com.google.cloud.retail.v2beta.AttributesConfig; +import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest; +import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse; import com.google.cloud.retail.v2beta.Catalog; import com.google.cloud.retail.v2beta.CompletionConfig; import com.google.cloud.retail.v2beta.GetAttributesConfigRequest; @@ -129,6 +131,9 @@ public class CatalogServiceStubSettings extends StubSettings removeCatalogAttributeSettings; + private final UnaryCallSettings< + BatchRemoveCatalogAttributesRequest, BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributesSettings; private final UnaryCallSettings replaceCatalogAttributeSettings; @@ -243,6 +248,13 @@ public UnaryCallSettings setDefaultBranchSetting return removeCatalogAttributeSettings; } + /** Returns the object with the settings used for calls to batchRemoveCatalogAttributes. */ + public UnaryCallSettings< + BatchRemoveCatalogAttributesRequest, BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributesSettings() { + return batchRemoveCatalogAttributesSettings; + } + /** Returns the object with the settings used for calls to replaceCatalogAttribute. */ public UnaryCallSettings replaceCatalogAttributeSettings() { @@ -365,6 +377,8 @@ protected CatalogServiceStubSettings(Builder settingsBuilder) throws IOException updateAttributesConfigSettings = settingsBuilder.updateAttributesConfigSettings().build(); addCatalogAttributeSettings = settingsBuilder.addCatalogAttributeSettings().build(); removeCatalogAttributeSettings = settingsBuilder.removeCatalogAttributeSettings().build(); + batchRemoveCatalogAttributesSettings = + settingsBuilder.batchRemoveCatalogAttributesSettings().build(); replaceCatalogAttributeSettings = settingsBuilder.replaceCatalogAttributeSettings().build(); } @@ -391,6 +405,9 @@ public static class Builder extends StubSettings.Builder removeCatalogAttributeSettings; + private final UnaryCallSettings.Builder< + BatchRemoveCatalogAttributesRequest, BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributesSettings; private final UnaryCallSettings.Builder replaceCatalogAttributeSettings; private static final ImmutableMap> @@ -443,6 +460,7 @@ protected Builder(ClientContext clientContext) { updateAttributesConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); addCatalogAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); removeCatalogAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + batchRemoveCatalogAttributesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); replaceCatalogAttributeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = @@ -457,6 +475,7 @@ protected Builder(ClientContext clientContext) { updateAttributesConfigSettings, addCatalogAttributeSettings, removeCatalogAttributeSettings, + batchRemoveCatalogAttributesSettings, replaceCatalogAttributeSettings); initDefaults(this); } @@ -474,6 +493,8 @@ protected Builder(CatalogServiceStubSettings settings) { updateAttributesConfigSettings = settings.updateAttributesConfigSettings.toBuilder(); addCatalogAttributeSettings = settings.addCatalogAttributeSettings.toBuilder(); removeCatalogAttributeSettings = settings.removeCatalogAttributeSettings.toBuilder(); + batchRemoveCatalogAttributesSettings = + settings.batchRemoveCatalogAttributesSettings.toBuilder(); replaceCatalogAttributeSettings = settings.replaceCatalogAttributeSettings.toBuilder(); unaryMethodSettingsBuilders = @@ -488,6 +509,7 @@ protected Builder(CatalogServiceStubSettings settings) { updateAttributesConfigSettings, addCatalogAttributeSettings, removeCatalogAttributeSettings, + batchRemoveCatalogAttributesSettings, replaceCatalogAttributeSettings); } @@ -568,6 +590,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder + .batchRemoveCatalogAttributesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .replaceCatalogAttributeSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) @@ -650,6 +677,13 @@ public UnaryCallSettings.Builder setDefaultBranc return removeCatalogAttributeSettings; } + /** Returns the builder for the settings used for calls to batchRemoveCatalogAttributes. */ + public UnaryCallSettings.Builder< + BatchRemoveCatalogAttributesRequest, BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributesSettings() { + return batchRemoveCatalogAttributesSettings; + } + /** Returns the builder for the settings used for calls to replaceCatalogAttribute. */ public UnaryCallSettings.Builder replaceCatalogAttributeSettings() { diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceStub.java index 67facb2dd3af..2fc8564ee174 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceStub.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcCatalogServiceStub.java @@ -27,6 +27,8 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.retail.v2beta.AddCatalogAttributeRequest; import com.google.cloud.retail.v2beta.AttributesConfig; +import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest; +import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse; import com.google.cloud.retail.v2beta.Catalog; import com.google.cloud.retail.v2beta.CompletionConfig; import com.google.cloud.retail.v2beta.GetAttributesConfigRequest; @@ -160,6 +162,21 @@ public class GrpcCatalogServiceStub extends CatalogServiceStub { .setResponseMarshaller(ProtoUtils.marshaller(AttributesConfig.getDefaultInstance())) .build(); + private static final MethodDescriptor< + BatchRemoveCatalogAttributesRequest, BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributesMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.retail.v2beta.CatalogService/BatchRemoveCatalogAttributes") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchRemoveCatalogAttributesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchRemoveCatalogAttributesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor replaceCatalogAttributeMethodDescriptor = MethodDescriptor.newBuilder() @@ -190,6 +207,9 @@ public class GrpcCatalogServiceStub extends CatalogServiceStub { addCatalogAttributeCallable; private final UnaryCallable removeCatalogAttributeCallable; + private final UnaryCallable< + BatchRemoveCatalogAttributesRequest, BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributesCallable; private final UnaryCallable replaceCatalogAttributeCallable; @@ -350,6 +370,20 @@ protected GrpcCatalogServiceStub( return params.build(); }) .build(); + GrpcCallSettings + batchRemoveCatalogAttributesTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(batchRemoveCatalogAttributesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "attributes_config", String.valueOf(request.getAttributesConfig())); + return params.build(); + }) + .build(); GrpcCallSettings replaceCatalogAttributeTransportSettings = GrpcCallSettings.newBuilder() @@ -408,6 +442,11 @@ protected GrpcCatalogServiceStub( removeCatalogAttributeTransportSettings, settings.removeCatalogAttributeSettings(), clientContext); + this.batchRemoveCatalogAttributesCallable = + callableFactory.createUnaryCallable( + batchRemoveCatalogAttributesTransportSettings, + settings.batchRemoveCatalogAttributesSettings(), + clientContext); this.replaceCatalogAttributeCallable = callableFactory.createUnaryCallable( replaceCatalogAttributeTransportSettings, @@ -481,6 +520,12 @@ public UnaryCallable addCatalogAtt return removeCatalogAttributeCallable; } + @Override + public UnaryCallable + batchRemoveCatalogAttributesCallable() { + return batchRemoveCatalogAttributesCallable; + } + @Override public UnaryCallable replaceCatalogAttributeCallable() { diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcModelServiceCallableFactory.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcModelServiceCallableFactory.java new file mode 100644 index 000000000000..f24c937d4e3d --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcModelServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2022 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 ModelService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcModelServiceCallableFactory 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/GrpcModelServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcModelServiceStub.java new file mode 100644 index 000000000000..5415e8024825 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/GrpcModelServiceStub.java @@ -0,0 +1,375 @@ +/* + * Copyright 2022 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 static com.google.cloud.retail.v2beta.ModelServiceClient.ListModelsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.retail.v2beta.CreateModelMetadata; +import com.google.cloud.retail.v2beta.CreateModelRequest; +import com.google.cloud.retail.v2beta.DeleteModelRequest; +import com.google.cloud.retail.v2beta.ListModelsRequest; +import com.google.cloud.retail.v2beta.ListModelsResponse; +import com.google.cloud.retail.v2beta.Model; +import com.google.cloud.retail.v2beta.PauseModelRequest; +import com.google.cloud.retail.v2beta.ResumeModelRequest; +import com.google.cloud.retail.v2beta.TuneModelMetadata; +import com.google.cloud.retail.v2beta.TuneModelRequest; +import com.google.cloud.retail.v2beta.TuneModelResponse; +import com.google.cloud.retail.v2beta.UpdateModelRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +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 ModelService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcModelServiceStub extends ModelServiceStub { + private static final MethodDescriptor createModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ModelService/CreateModel") + .setRequestMarshaller(ProtoUtils.marshaller(CreateModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor pauseModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ModelService/PauseModel") + .setRequestMarshaller(ProtoUtils.marshaller(PauseModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Model.getDefaultInstance())) + .build(); + + private static final MethodDescriptor resumeModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ModelService/ResumeModel") + .setRequestMarshaller(ProtoUtils.marshaller(ResumeModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Model.getDefaultInstance())) + .build(); + + private static final MethodDescriptor deleteModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ModelService/DeleteModel") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listModelsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ModelService/ListModels") + .setRequestMarshaller(ProtoUtils.marshaller(ListModelsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListModelsResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor updateModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ModelService/UpdateModel") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Model.getDefaultInstance())) + .build(); + + private static final MethodDescriptor tuneModelMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.retail.v2beta.ModelService/TuneModel") + .setRequestMarshaller(ProtoUtils.marshaller(TuneModelRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable createModelCallable; + private final OperationCallable + createModelOperationCallable; + private final UnaryCallable pauseModelCallable; + private final UnaryCallable resumeModelCallable; + private final UnaryCallable deleteModelCallable; + private final UnaryCallable listModelsCallable; + private final UnaryCallable listModelsPagedCallable; + private final UnaryCallable updateModelCallable; + private final UnaryCallable tuneModelCallable; + private final OperationCallable + tuneModelOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcModelServiceStub create(ModelServiceStubSettings settings) + throws IOException { + return new GrpcModelServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcModelServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcModelServiceStub(ModelServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcModelServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcModelServiceStub( + ModelServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcModelServiceStub, 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 GrpcModelServiceStub(ModelServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcModelServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcModelServiceStub, 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 GrpcModelServiceStub( + ModelServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings createModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createModelMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings pauseModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(pauseModelMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings resumeModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(resumeModelMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings deleteModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteModelMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listModelsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listModelsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings updateModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateModelMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("model.name", String.valueOf(request.getModel().getName())); + return params.build(); + }) + .build(); + GrpcCallSettings tuneModelTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(tuneModelMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + + this.createModelCallable = + callableFactory.createUnaryCallable( + createModelTransportSettings, settings.createModelSettings(), clientContext); + this.createModelOperationCallable = + callableFactory.createOperationCallable( + createModelTransportSettings, + settings.createModelOperationSettings(), + clientContext, + operationsStub); + this.pauseModelCallable = + callableFactory.createUnaryCallable( + pauseModelTransportSettings, settings.pauseModelSettings(), clientContext); + this.resumeModelCallable = + callableFactory.createUnaryCallable( + resumeModelTransportSettings, settings.resumeModelSettings(), clientContext); + this.deleteModelCallable = + callableFactory.createUnaryCallable( + deleteModelTransportSettings, settings.deleteModelSettings(), clientContext); + this.listModelsCallable = + callableFactory.createUnaryCallable( + listModelsTransportSettings, settings.listModelsSettings(), clientContext); + this.listModelsPagedCallable = + callableFactory.createPagedCallable( + listModelsTransportSettings, settings.listModelsSettings(), clientContext); + this.updateModelCallable = + callableFactory.createUnaryCallable( + updateModelTransportSettings, settings.updateModelSettings(), clientContext); + this.tuneModelCallable = + callableFactory.createUnaryCallable( + tuneModelTransportSettings, settings.tuneModelSettings(), clientContext); + this.tuneModelOperationCallable = + callableFactory.createOperationCallable( + tuneModelTransportSettings, + settings.tuneModelOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createModelCallable() { + return createModelCallable; + } + + @Override + public OperationCallable + createModelOperationCallable() { + return createModelOperationCallable; + } + + @Override + public UnaryCallable pauseModelCallable() { + return pauseModelCallable; + } + + @Override + public UnaryCallable resumeModelCallable() { + return resumeModelCallable; + } + + @Override + public UnaryCallable deleteModelCallable() { + return deleteModelCallable; + } + + @Override + public UnaryCallable listModelsCallable() { + return listModelsCallable; + } + + @Override + public UnaryCallable listModelsPagedCallable() { + return listModelsPagedCallable; + } + + @Override + public UnaryCallable updateModelCallable() { + return updateModelCallable; + } + + @Override + public UnaryCallable tuneModelCallable() { + return tuneModelCallable; + } + + @Override + public OperationCallable + tuneModelOperationCallable() { + return tuneModelOperationCallable; + } + + @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/HttpJsonCatalogServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonCatalogServiceStub.java index f1021c22a3e2..6bd6d44a781f 100644 --- a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonCatalogServiceStub.java +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonCatalogServiceStub.java @@ -32,6 +32,8 @@ import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.retail.v2beta.AddCatalogAttributeRequest; import com.google.cloud.retail.v2beta.AttributesConfig; +import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest; +import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse; import com.google.cloud.retail.v2beta.Catalog; import com.google.cloud.retail.v2beta.CompletionConfig; import com.google.cloud.retail.v2beta.GetAttributesConfigRequest; @@ -428,6 +430,47 @@ public class HttpJsonCatalogServiceStub extends CatalogServiceStub { .build()) .build(); + private static final ApiMethodDescriptor< + BatchRemoveCatalogAttributesRequest, BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributesMethodDescriptor = + ApiMethodDescriptor + . + newBuilder() + .setFullMethodName( + "google.cloud.retail.v2beta.CatalogService/BatchRemoveCatalogAttributes") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{attributesConfig=projects/*/locations/*/catalogs/*/attributesConfig}:batchRemoveCatalogAttributes", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "attributesConfig", request.getAttributesConfig()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearAttributesConfig().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BatchRemoveCatalogAttributesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private static final ApiMethodDescriptor replaceCatalogAttributeMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -485,6 +528,9 @@ public class HttpJsonCatalogServiceStub extends CatalogServiceStub { addCatalogAttributeCallable; private final UnaryCallable removeCatalogAttributeCallable; + private final UnaryCallable< + BatchRemoveCatalogAttributesRequest, BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributesCallable; private final UnaryCallable replaceCatalogAttributeCallable; @@ -587,6 +633,14 @@ protected HttpJsonCatalogServiceStub( .setMethodDescriptor(removeCatalogAttributeMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + batchRemoveCatalogAttributesTransportSettings = + HttpJsonCallSettings + . + newBuilder() + .setMethodDescriptor(batchRemoveCatalogAttributesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings replaceCatalogAttributeTransportSettings = HttpJsonCallSettings.newBuilder() @@ -639,6 +693,11 @@ protected HttpJsonCatalogServiceStub( removeCatalogAttributeTransportSettings, settings.removeCatalogAttributeSettings(), clientContext); + this.batchRemoveCatalogAttributesCallable = + callableFactory.createUnaryCallable( + batchRemoveCatalogAttributesTransportSettings, + settings.batchRemoveCatalogAttributesSettings(), + clientContext); this.replaceCatalogAttributeCallable = callableFactory.createUnaryCallable( replaceCatalogAttributeTransportSettings, @@ -662,6 +721,7 @@ public static List getMethodDescriptors() { methodDescriptors.add(updateAttributesConfigMethodDescriptor); methodDescriptors.add(addCatalogAttributeMethodDescriptor); methodDescriptors.add(removeCatalogAttributeMethodDescriptor); + methodDescriptors.add(batchRemoveCatalogAttributesMethodDescriptor); methodDescriptors.add(replaceCatalogAttributeMethodDescriptor); return methodDescriptors; } @@ -725,6 +785,12 @@ public UnaryCallable addCatalogAtt return removeCatalogAttributeCallable; } + @Override + public UnaryCallable + batchRemoveCatalogAttributesCallable() { + return batchRemoveCatalogAttributesCallable; + } + @Override public UnaryCallable replaceCatalogAttributeCallable() { diff --git a/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonModelServiceCallableFactory.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonModelServiceCallableFactory.java new file mode 100644 index 000000000000..88ab4ce4ad9c --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonModelServiceCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 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 ModelService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonModelServiceCallableFactory + 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/HttpJsonModelServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonModelServiceStub.java new file mode 100644 index 000000000000..617e02c84c8d --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/HttpJsonModelServiceStub.java @@ -0,0 +1,563 @@ +/* + * Copyright 2022 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 static com.google.cloud.retail.v2beta.ModelServiceClient.ListModelsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.retail.v2beta.CreateModelMetadata; +import com.google.cloud.retail.v2beta.CreateModelRequest; +import com.google.cloud.retail.v2beta.DeleteModelRequest; +import com.google.cloud.retail.v2beta.ListModelsRequest; +import com.google.cloud.retail.v2beta.ListModelsResponse; +import com.google.cloud.retail.v2beta.Model; +import com.google.cloud.retail.v2beta.PauseModelRequest; +import com.google.cloud.retail.v2beta.ResumeModelRequest; +import com.google.cloud.retail.v2beta.TuneModelMetadata; +import com.google.cloud.retail.v2beta.TuneModelRequest; +import com.google.cloud.retail.v2beta.TuneModelResponse; +import com.google.cloud.retail.v2beta.UpdateModelRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +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 ModelService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonModelServiceStub extends ModelServiceStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(TuneModelMetadata.getDescriptor()) + .add(CreateModelMetadata.getDescriptor()) + .add(Model.getDescriptor()) + .add(TuneModelResponse.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + createModelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.retail.v2beta.ModelService/CreateModel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{parent=projects/*/locations/*/catalogs/*}/models", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "dryRun", request.getDryRun()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("model", request.getModel())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateModelRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor pauseModelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.retail.v2beta.ModelService/PauseModel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{name=projects/*/locations/*/catalogs/*/models/*}:pause", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Model.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor resumeModelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.retail.v2beta.ModelService/ResumeModel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{name=projects/*/locations/*/catalogs/*/models/*}:resume", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Model.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor deleteModelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.retail.v2beta.ModelService/DeleteModel") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{name=projects/*/locations/*/catalogs/*/models/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listModelsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.retail.v2beta.ModelService/ListModels") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{parent=projects/*/locations/*/catalogs/*}/models", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListModelsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor updateModelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.retail.v2beta.ModelService/UpdateModel") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{model.name=projects/*/locations/*/catalogs/*/models/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "model.name", request.getModel().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + return fields; + }) + .setRequestBodyExtractor( + request -> ProtoRestSerializer.create().toBody("model", request.getModel())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Model.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor tuneModelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.retail.v2beta.ModelService/TuneModel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v2beta/{name=projects/*/locations/*/catalogs/*/models/*}:tune", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (TuneModelRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable createModelCallable; + private final OperationCallable + createModelOperationCallable; + private final UnaryCallable pauseModelCallable; + private final UnaryCallable resumeModelCallable; + private final UnaryCallable deleteModelCallable; + private final UnaryCallable listModelsCallable; + private final UnaryCallable listModelsPagedCallable; + private final UnaryCallable updateModelCallable; + private final UnaryCallable tuneModelCallable; + private final OperationCallable + tuneModelOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonModelServiceStub create(ModelServiceStubSettings settings) + throws IOException { + return new HttpJsonModelServiceStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonModelServiceStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonModelServiceStub( + ModelServiceStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonModelServiceStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonModelServiceStub( + ModelServiceStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonModelServiceStub, 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 HttpJsonModelServiceStub(ModelServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonModelServiceCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonModelServiceStub, 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 HttpJsonModelServiceStub( + ModelServiceStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings createModelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createModelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings pauseModelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(pauseModelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings resumeModelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(resumeModelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteModelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteModelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listModelsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listModelsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateModelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateModelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings tuneModelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(tuneModelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.createModelCallable = + callableFactory.createUnaryCallable( + createModelTransportSettings, settings.createModelSettings(), clientContext); + this.createModelOperationCallable = + callableFactory.createOperationCallable( + createModelTransportSettings, + settings.createModelOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.pauseModelCallable = + callableFactory.createUnaryCallable( + pauseModelTransportSettings, settings.pauseModelSettings(), clientContext); + this.resumeModelCallable = + callableFactory.createUnaryCallable( + resumeModelTransportSettings, settings.resumeModelSettings(), clientContext); + this.deleteModelCallable = + callableFactory.createUnaryCallable( + deleteModelTransportSettings, settings.deleteModelSettings(), clientContext); + this.listModelsCallable = + callableFactory.createUnaryCallable( + listModelsTransportSettings, settings.listModelsSettings(), clientContext); + this.listModelsPagedCallable = + callableFactory.createPagedCallable( + listModelsTransportSettings, settings.listModelsSettings(), clientContext); + this.updateModelCallable = + callableFactory.createUnaryCallable( + updateModelTransportSettings, settings.updateModelSettings(), clientContext); + this.tuneModelCallable = + callableFactory.createUnaryCallable( + tuneModelTransportSettings, settings.tuneModelSettings(), clientContext); + this.tuneModelOperationCallable = + callableFactory.createOperationCallable( + tuneModelTransportSettings, + settings.tuneModelOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createModelMethodDescriptor); + methodDescriptors.add(pauseModelMethodDescriptor); + methodDescriptors.add(resumeModelMethodDescriptor); + methodDescriptors.add(deleteModelMethodDescriptor); + methodDescriptors.add(listModelsMethodDescriptor); + methodDescriptors.add(updateModelMethodDescriptor); + methodDescriptors.add(tuneModelMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable createModelCallable() { + return createModelCallable; + } + + @Override + public OperationCallable + createModelOperationCallable() { + return createModelOperationCallable; + } + + @Override + public UnaryCallable pauseModelCallable() { + return pauseModelCallable; + } + + @Override + public UnaryCallable resumeModelCallable() { + return resumeModelCallable; + } + + @Override + public UnaryCallable deleteModelCallable() { + return deleteModelCallable; + } + + @Override + public UnaryCallable listModelsCallable() { + return listModelsCallable; + } + + @Override + public UnaryCallable listModelsPagedCallable() { + return listModelsPagedCallable; + } + + @Override + public UnaryCallable updateModelCallable() { + return updateModelCallable; + } + + @Override + public UnaryCallable tuneModelCallable() { + return tuneModelCallable; + } + + @Override + public OperationCallable + tuneModelOperationCallable() { + return tuneModelOperationCallable; + } + + @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/ModelServiceStub.java b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ModelServiceStub.java new file mode 100644 index 000000000000..c31a53480cfd --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ModelServiceStub.java @@ -0,0 +1,104 @@ +/* + * Copyright 2022 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 static com.google.cloud.retail.v2beta.ModelServiceClient.ListModelsPagedResponse; + +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.CreateModelMetadata; +import com.google.cloud.retail.v2beta.CreateModelRequest; +import com.google.cloud.retail.v2beta.DeleteModelRequest; +import com.google.cloud.retail.v2beta.ListModelsRequest; +import com.google.cloud.retail.v2beta.ListModelsResponse; +import com.google.cloud.retail.v2beta.Model; +import com.google.cloud.retail.v2beta.PauseModelRequest; +import com.google.cloud.retail.v2beta.ResumeModelRequest; +import com.google.cloud.retail.v2beta.TuneModelMetadata; +import com.google.cloud.retail.v2beta.TuneModelRequest; +import com.google.cloud.retail.v2beta.TuneModelResponse; +import com.google.cloud.retail.v2beta.UpdateModelRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the ModelService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class ModelServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public OperationCallable + createModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createModelOperationCallable()"); + } + + public UnaryCallable createModelCallable() { + throw new UnsupportedOperationException("Not implemented: createModelCallable()"); + } + + public UnaryCallable pauseModelCallable() { + throw new UnsupportedOperationException("Not implemented: pauseModelCallable()"); + } + + public UnaryCallable resumeModelCallable() { + throw new UnsupportedOperationException("Not implemented: resumeModelCallable()"); + } + + public UnaryCallable deleteModelCallable() { + throw new UnsupportedOperationException("Not implemented: deleteModelCallable()"); + } + + public UnaryCallable listModelsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listModelsPagedCallable()"); + } + + public UnaryCallable listModelsCallable() { + throw new UnsupportedOperationException("Not implemented: listModelsCallable()"); + } + + public UnaryCallable updateModelCallable() { + throw new UnsupportedOperationException("Not implemented: updateModelCallable()"); + } + + public OperationCallable + tuneModelOperationCallable() { + throw new UnsupportedOperationException("Not implemented: tuneModelOperationCallable()"); + } + + public UnaryCallable tuneModelCallable() { + throw new UnsupportedOperationException("Not implemented: tuneModelCallable()"); + } + + @Override + public abstract void close(); +} 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 new file mode 100644 index 000000000000..45b1e3e62563 --- /dev/null +++ b/java-retail/google-cloud-retail/src/main/java/com/google/cloud/retail/v2beta/stub/ModelServiceStubSettings.java @@ -0,0 +1,618 @@ +/* + * Copyright 2022 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 static com.google.cloud.retail.v2beta.ModelServiceClient.ListModelsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +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.ApiCallContext; +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.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +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.api.gax.rpc.UnaryCallable; +import com.google.cloud.retail.v2beta.CreateModelMetadata; +import com.google.cloud.retail.v2beta.CreateModelRequest; +import com.google.cloud.retail.v2beta.DeleteModelRequest; +import com.google.cloud.retail.v2beta.ListModelsRequest; +import com.google.cloud.retail.v2beta.ListModelsResponse; +import com.google.cloud.retail.v2beta.Model; +import com.google.cloud.retail.v2beta.PauseModelRequest; +import com.google.cloud.retail.v2beta.ResumeModelRequest; +import com.google.cloud.retail.v2beta.TuneModelMetadata; +import com.google.cloud.retail.v2beta.TuneModelRequest; +import com.google.cloud.retail.v2beta.TuneModelResponse; +import com.google.cloud.retail.v2beta.UpdateModelRequest; +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 com.google.protobuf.Empty; +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 ModelServiceStub}. + * + *

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 pauseModel to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * ModelServiceStubSettings.Builder modelServiceSettingsBuilder =
+ *     ModelServiceStubSettings.newBuilder();
+ * modelServiceSettingsBuilder
+ *     .pauseModelSettings()
+ *     .setRetrySettings(
+ *         modelServiceSettingsBuilder
+ *             .pauseModelSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * ModelServiceStubSettings modelServiceSettings = modelServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ModelServiceStubSettings 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 createModelSettings; + private final OperationCallSettings + createModelOperationSettings; + private final UnaryCallSettings pauseModelSettings; + private final UnaryCallSettings resumeModelSettings; + private final UnaryCallSettings deleteModelSettings; + private final PagedCallSettings + listModelsSettings; + private final UnaryCallSettings updateModelSettings; + private final UnaryCallSettings tuneModelSettings; + private final OperationCallSettings + tuneModelOperationSettings; + + private static final PagedListDescriptor + LIST_MODELS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListModelsRequest injectToken(ListModelsRequest payload, String token) { + return ListModelsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListModelsRequest injectPageSize(ListModelsRequest payload, int pageSize) { + return ListModelsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListModelsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListModelsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListModelsResponse payload) { + return payload.getModelsList() == null + ? ImmutableList.of() + : payload.getModelsList(); + } + }; + + private static final PagedListResponseFactory< + ListModelsRequest, ListModelsResponse, ListModelsPagedResponse> + LIST_MODELS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListModelsRequest, ListModelsResponse, ListModelsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListModelsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_MODELS_PAGE_STR_DESC, request, context); + return ListModelsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createModel. */ + public UnaryCallSettings createModelSettings() { + return createModelSettings; + } + + /** Returns the object with the settings used for calls to createModel. */ + public OperationCallSettings + createModelOperationSettings() { + return createModelOperationSettings; + } + + /** Returns the object with the settings used for calls to pauseModel. */ + public UnaryCallSettings pauseModelSettings() { + return pauseModelSettings; + } + + /** Returns the object with the settings used for calls to resumeModel. */ + public UnaryCallSettings resumeModelSettings() { + return resumeModelSettings; + } + + /** Returns the object with the settings used for calls to deleteModel. */ + public UnaryCallSettings deleteModelSettings() { + return deleteModelSettings; + } + + /** Returns the object with the settings used for calls to listModels. */ + public PagedCallSettings + listModelsSettings() { + return listModelsSettings; + } + + /** Returns the object with the settings used for calls to updateModel. */ + public UnaryCallSettings updateModelSettings() { + return updateModelSettings; + } + + /** Returns the object with the settings used for calls to tuneModel. */ + public UnaryCallSettings tuneModelSettings() { + return tuneModelSettings; + } + + /** Returns the object with the settings used for calls to tuneModel. */ + public OperationCallSettings + tuneModelOperationSettings() { + return tuneModelOperationSettings; + } + + public ModelServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcModelServiceStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonModelServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** 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(ModelServiceStubSettings.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(ModelServiceStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ModelServiceStubSettings.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 ModelServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createModelSettings = settingsBuilder.createModelSettings().build(); + createModelOperationSettings = settingsBuilder.createModelOperationSettings().build(); + pauseModelSettings = settingsBuilder.pauseModelSettings().build(); + resumeModelSettings = settingsBuilder.resumeModelSettings().build(); + deleteModelSettings = settingsBuilder.deleteModelSettings().build(); + listModelsSettings = settingsBuilder.listModelsSettings().build(); + updateModelSettings = settingsBuilder.updateModelSettings().build(); + tuneModelSettings = settingsBuilder.tuneModelSettings().build(); + tuneModelOperationSettings = settingsBuilder.tuneModelOperationSettings().build(); + } + + /** Builder for ModelServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createModelSettings; + private final OperationCallSettings.Builder + createModelOperationSettings; + private final UnaryCallSettings.Builder pauseModelSettings; + private final UnaryCallSettings.Builder resumeModelSettings; + private final UnaryCallSettings.Builder deleteModelSettings; + private final PagedCallSettings.Builder< + ListModelsRequest, ListModelsResponse, ListModelsPagedResponse> + listModelsSettings; + private final UnaryCallSettings.Builder updateModelSettings; + private final UnaryCallSettings.Builder tuneModelSettings; + private final OperationCallSettings.Builder< + TuneModelRequest, TuneModelResponse, TuneModelMetadata> + tuneModelOperationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createModelOperationSettings = OperationCallSettings.newBuilder(); + pauseModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + resumeModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listModelsSettings = PagedCallSettings.newBuilder(LIST_MODELS_PAGE_STR_FACT); + updateModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + tuneModelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + tuneModelOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createModelSettings, + pauseModelSettings, + resumeModelSettings, + deleteModelSettings, + listModelsSettings, + updateModelSettings, + tuneModelSettings); + initDefaults(this); + } + + protected Builder(ModelServiceStubSettings settings) { + super(settings); + + createModelSettings = settings.createModelSettings.toBuilder(); + createModelOperationSettings = settings.createModelOperationSettings.toBuilder(); + pauseModelSettings = settings.pauseModelSettings.toBuilder(); + resumeModelSettings = settings.resumeModelSettings.toBuilder(); + deleteModelSettings = settings.deleteModelSettings.toBuilder(); + listModelsSettings = settings.listModelsSettings.toBuilder(); + updateModelSettings = settings.updateModelSettings.toBuilder(); + tuneModelSettings = settings.tuneModelSettings.toBuilder(); + tuneModelOperationSettings = settings.tuneModelOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createModelSettings, + pauseModelSettings, + resumeModelSettings, + deleteModelSettings, + listModelsSettings, + updateModelSettings, + tuneModelSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + 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.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .createModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .pauseModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .resumeModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .deleteModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listModelsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .tuneModelSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .createModelOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Model.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(CreateModelMetadata.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())); + + builder + .tuneModelOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(TuneModelResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(TuneModelMetadata.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 createModel. */ + public UnaryCallSettings.Builder createModelSettings() { + return createModelSettings; + } + + /** Returns the builder for the settings used for calls to createModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createModelOperationSettings() { + return createModelOperationSettings; + } + + /** Returns the builder for the settings used for calls to pauseModel. */ + public UnaryCallSettings.Builder pauseModelSettings() { + return pauseModelSettings; + } + + /** Returns the builder for the settings used for calls to resumeModel. */ + public UnaryCallSettings.Builder resumeModelSettings() { + return resumeModelSettings; + } + + /** Returns the builder for the settings used for calls to deleteModel. */ + public UnaryCallSettings.Builder deleteModelSettings() { + return deleteModelSettings; + } + + /** Returns the builder for the settings used for calls to listModels. */ + public PagedCallSettings.Builder + listModelsSettings() { + return listModelsSettings; + } + + /** Returns the builder for the settings used for calls to updateModel. */ + public UnaryCallSettings.Builder updateModelSettings() { + return updateModelSettings; + } + + /** Returns the builder for the settings used for calls to tuneModel. */ + public UnaryCallSettings.Builder tuneModelSettings() { + return tuneModelSettings; + } + + /** Returns the builder for the settings used for calls to tuneModel. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + tuneModelOperationSettings() { + return tuneModelOperationSettings; + } + + @Override + public ModelServiceStubSettings build() throws IOException { + return new ModelServiceStubSettings(this); + } + } +} diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientHttpJsonTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientHttpJsonTest.java index 83ae3ee5b338..02b7a52af8b0 100644 --- a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientHttpJsonTest.java +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientHttpJsonTest.java @@ -33,6 +33,7 @@ import com.google.protobuf.FieldMask; import com.google.protobuf.Timestamp; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -868,6 +869,62 @@ public void removeCatalogAttributeExceptionTest() throws Exception { } } + @Test + public void batchRemoveCatalogAttributesTest() throws Exception { + BatchRemoveCatalogAttributesResponse expectedResponse = + BatchRemoveCatalogAttributesResponse.newBuilder() + .addAllDeletedCatalogAttributes(new ArrayList()) + .addAllResetCatalogAttributes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + BatchRemoveCatalogAttributesRequest request = + BatchRemoveCatalogAttributesRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .addAllAttributeKeys(new ArrayList()) + .build(); + + BatchRemoveCatalogAttributesResponse actualResponse = + client.batchRemoveCatalogAttributes(request); + 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 batchRemoveCatalogAttributesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + BatchRemoveCatalogAttributesRequest request = + BatchRemoveCatalogAttributesRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .addAllAttributeKeys(new ArrayList()) + .build(); + client.batchRemoveCatalogAttributes(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void replaceCatalogAttributeTest() throws Exception { AttributesConfig expectedResponse = diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientTest.java index 3978f47cf4b3..a1da13923e4a 100644 --- a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientTest.java +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/CatalogServiceClientTest.java @@ -32,6 +32,7 @@ import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; @@ -737,6 +738,58 @@ public void removeCatalogAttributeExceptionTest() throws Exception { } } + @Test + public void batchRemoveCatalogAttributesTest() throws Exception { + BatchRemoveCatalogAttributesResponse expectedResponse = + BatchRemoveCatalogAttributesResponse.newBuilder() + .addAllDeletedCatalogAttributes(new ArrayList()) + .addAllResetCatalogAttributes(new ArrayList()) + .build(); + mockCatalogService.addResponse(expectedResponse); + + BatchRemoveCatalogAttributesRequest request = + BatchRemoveCatalogAttributesRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .addAllAttributeKeys(new ArrayList()) + .build(); + + BatchRemoveCatalogAttributesResponse actualResponse = + client.batchRemoveCatalogAttributes(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCatalogService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchRemoveCatalogAttributesRequest actualRequest = + ((BatchRemoveCatalogAttributesRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getAttributesConfig(), actualRequest.getAttributesConfig()); + Assert.assertEquals(request.getAttributeKeysList(), actualRequest.getAttributeKeysList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void batchRemoveCatalogAttributesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCatalogService.addException(exception); + + try { + BatchRemoveCatalogAttributesRequest request = + BatchRemoveCatalogAttributesRequest.newBuilder() + .setAttributesConfig( + AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString()) + .addAllAttributeKeys(new ArrayList()) + .build(); + client.batchRemoveCatalogAttributes(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void replaceCatalogAttributeTest() throws Exception { AttributesConfig expectedResponse = diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientHttpJsonTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientHttpJsonTest.java index 78d3f2e48549..428b9af29f09 100644 --- a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientHttpJsonTest.java +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientHttpJsonTest.java @@ -86,6 +86,7 @@ public void createControlTest() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -137,6 +138,7 @@ public void createControlTest2() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -270,6 +272,7 @@ public void updateControlTest() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -279,6 +282,7 @@ public void updateControlTest() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -315,6 +319,7 @@ public void updateControlExceptionTest() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateControl(control, updateMask); @@ -332,6 +337,7 @@ public void getControlTest() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -379,6 +385,7 @@ public void getControlTest2() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); mockService.addResponse(expectedResponse); diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientTest.java index 7362283bb1d5..49f22f8891eb 100644 --- a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientTest.java +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ControlServiceClientTest.java @@ -89,6 +89,7 @@ public void createControlTest() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); mockControlService.addResponse(expectedResponse); @@ -136,6 +137,7 @@ public void createControlTest2() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); mockControlService.addResponse(expectedResponse); @@ -251,6 +253,7 @@ public void updateControlTest() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); mockControlService.addResponse(expectedResponse); @@ -295,6 +298,7 @@ public void getControlTest() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); mockControlService.addResponse(expectedResponse); @@ -336,6 +340,7 @@ public void getControlTest2() throws Exception { .setDisplayName("displayName1714148973") .addAllAssociatedServingConfigIds(new ArrayList()) .addAllSolutionTypes(new ArrayList()) + .addAllSearchSolutionUseCase(new ArrayList()) .build(); mockControlService.addResponse(expectedResponse); diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogServiceImpl.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogServiceImpl.java index 2898705e0427..1f22c8b89d5c 100644 --- a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogServiceImpl.java +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockCatalogServiceImpl.java @@ -269,6 +269,28 @@ public void removeCatalogAttribute( } } + @Override + public void batchRemoveCatalogAttributes( + BatchRemoveCatalogAttributesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof BatchRemoveCatalogAttributesResponse) { + requests.add(request); + responseObserver.onNext(((BatchRemoveCatalogAttributesResponse) 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 BatchRemoveCatalogAttributes, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + BatchRemoveCatalogAttributesResponse.class.getName(), + Exception.class.getName()))); + } + } + @Override public void replaceCatalogAttribute( ReplaceCatalogAttributeRequest request, StreamObserver responseObserver) { diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockModelService.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockModelService.java new file mode 100644 index 000000000000..c3f0c0b142bf --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockModelService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 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 MockModelService implements MockGrpcService { + private final MockModelServiceImpl serviceImpl; + + public MockModelService() { + serviceImpl = new MockModelServiceImpl(); + } + + @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/MockModelServiceImpl.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockModelServiceImpl.java new file mode 100644 index 000000000000..6c37f33321cd --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/MockModelServiceImpl.java @@ -0,0 +1,203 @@ +/* + * Copyright 2022 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.ModelServiceGrpc.ModelServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +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 MockModelServiceImpl extends ModelServiceImplBase { + private List requests; + private Queue responses; + + public MockModelServiceImpl() { + 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 createModel(CreateModelRequest 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 CreateModel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void pauseModel(PauseModelRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Model) { + requests.add(request); + responseObserver.onNext(((Model) 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 PauseModel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Model.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void resumeModel(ResumeModelRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Model) { + requests.add(request); + responseObserver.onNext(((Model) 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 ResumeModel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Model.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void deleteModel(DeleteModelRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext(((Empty) 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 DeleteModel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listModels( + ListModelsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListModelsResponse) { + requests.add(request); + responseObserver.onNext(((ListModelsResponse) 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 ListModels, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListModelsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void updateModel(UpdateModelRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Model) { + requests.add(request); + responseObserver.onNext(((Model) 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 UpdateModel, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Model.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void tuneModel(TuneModelRequest 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 TuneModel, 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/ModelServiceClientHttpJsonTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ModelServiceClientHttpJsonTest.java new file mode 100644 index 000000000000..63dbef2bd8b8 --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ModelServiceClientHttpJsonTest.java @@ -0,0 +1,722 @@ +/* + * Copyright 2022 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 com.google.cloud.retail.v2beta.ModelServiceClient.ListModelsPagedResponse; + +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.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.retail.v2beta.stub.HttpJsonModelServiceStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +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 ModelServiceClientHttpJsonTest { + private static MockHttpService mockService; + private static ModelServiceClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonModelServiceStub.getMethodDescriptors(), + ModelServiceSettings.getDefaultEndpoint()); + ModelServiceSettings settings = + ModelServiceSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + ModelServiceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ModelServiceClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void createModelTest() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + Model model = Model.newBuilder().build(); + + Model actualResponse = client.createModelAsync(parent, model).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 createModelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + Model model = Model.newBuilder().build(); + client.createModelAsync(parent, model).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createModelTest2() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-6267/locations/location-6267/catalogs/catalog-6267"; + Model model = Model.newBuilder().build(); + + Model actualResponse = client.createModelAsync(parent, model).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 createModelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-6267/locations/location-6267/catalogs/catalog-6267"; + Model model = Model.newBuilder().build(); + client.createModelAsync(parent, model).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void pauseModelTest() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + + Model actualResponse = client.pauseModel(name); + 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 pauseModelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + client.pauseModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pauseModelTest2() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-7594/locations/location-7594/catalogs/catalog-7594/models/model-7594"; + + Model actualResponse = client.pauseModel(name); + 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 pauseModelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7594/locations/location-7594/catalogs/catalog-7594/models/model-7594"; + client.pauseModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resumeModelTest() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-7594/locations/location-7594/catalogs/catalog-7594/models/model-7594"; + + Model actualResponse = client.resumeModel(name); + 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 resumeModelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7594/locations/location-7594/catalogs/catalog-7594/models/model-7594"; + client.resumeModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteModelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + + client.deleteModel(name); + + 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 deleteModelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + client.deleteModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteModelTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-7594/locations/location-7594/catalogs/catalog-7594/models/model-7594"; + + client.deleteModel(name); + + 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 deleteModelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7594/locations/location-7594/catalogs/catalog-7594/models/model-7594"; + client.deleteModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listModelsTest() throws Exception { + Model responsesElement = Model.newBuilder().build(); + ListModelsResponse expectedResponse = + ListModelsResponse.newBuilder() + .setNextPageToken("") + .addAllModels(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + ListModelsPagedResponse pagedListResponse = client.listModels(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getModelsList().get(0), resources.get(0)); + + 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 listModelsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.listModels(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listModelsTest2() throws Exception { + Model responsesElement = Model.newBuilder().build(); + ListModelsResponse expectedResponse = + ListModelsResponse.newBuilder() + .setNextPageToken("") + .addAllModels(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-6267/locations/location-6267/catalogs/catalog-6267"; + + ListModelsPagedResponse pagedListResponse = client.listModels(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getModelsList().get(0), resources.get(0)); + + 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 listModelsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-6267/locations/location-6267/catalogs/catalog-6267"; + client.listModels(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateModelTest() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + Model model = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Model actualResponse = client.updateModel(model, updateMask); + 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 updateModelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Model model = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateModel(model, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void tuneModelTest() throws Exception { + TuneModelResponse expectedResponse = TuneModelResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("tuneModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + + TuneModelResponse actualResponse = client.tuneModelAsync(name).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 tuneModelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + client.tuneModelAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void tuneModelTest2() throws Exception { + TuneModelResponse expectedResponse = TuneModelResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("tuneModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-7594/locations/location-7594/catalogs/catalog-7594/models/model-7594"; + + TuneModelResponse actualResponse = client.tuneModelAsync(name).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 tuneModelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-7594/locations/location-7594/catalogs/catalog-7594/models/model-7594"; + client.tuneModelAsync(name).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/ModelServiceClientTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ModelServiceClientTest.java new file mode 100644 index 000000000000..b5d20118c692 --- /dev/null +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ModelServiceClientTest.java @@ -0,0 +1,637 @@ +/* + * Copyright 2022 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 com.google.cloud.retail.v2beta.ModelServiceClient.ListModelsPagedResponse; + +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.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +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 ModelServiceClientTest { + private static MockModelService mockModelService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ModelServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockModelService = new MockModelService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockModelService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + ModelServiceSettings settings = + ModelServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ModelServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void createModelTest() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockModelService.addResponse(resultOperation); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + Model model = Model.newBuilder().build(); + + Model actualResponse = client.createModelAsync(parent, model).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateModelRequest actualRequest = ((CreateModelRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(model, actualRequest.getModel()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + Model model = Model.newBuilder().build(); + client.createModelAsync(parent, model).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()); + } + } + + @Test + public void createModelTest2() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockModelService.addResponse(resultOperation); + + String parent = "parent-995424086"; + Model model = Model.newBuilder().build(); + + Model actualResponse = client.createModelAsync(parent, model).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateModelRequest actualRequest = ((CreateModelRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(model, actualRequest.getModel()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createModelExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + String parent = "parent-995424086"; + Model model = Model.newBuilder().build(); + client.createModelAsync(parent, model).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()); + } + } + + @Test + public void pauseModelTest() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + mockModelService.addResponse(expectedResponse); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + + Model actualResponse = client.pauseModel(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PauseModelRequest actualRequest = ((PauseModelRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pauseModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + client.pauseModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void pauseModelTest2() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + mockModelService.addResponse(expectedResponse); + + String name = "name3373707"; + + Model actualResponse = client.pauseModel(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + PauseModelRequest actualRequest = ((PauseModelRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void pauseModelExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + String name = "name3373707"; + client.pauseModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void resumeModelTest() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + mockModelService.addResponse(expectedResponse); + + String name = "name3373707"; + + Model actualResponse = client.resumeModel(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ResumeModelRequest actualRequest = ((ResumeModelRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void resumeModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + String name = "name3373707"; + client.resumeModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteModelTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockModelService.addResponse(expectedResponse); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + + client.deleteModel(name); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteModelRequest actualRequest = ((DeleteModelRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + client.deleteModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteModelTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockModelService.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteModel(name); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteModelRequest actualRequest = ((DeleteModelRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteModelExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + String name = "name3373707"; + client.deleteModel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listModelsTest() throws Exception { + Model responsesElement = Model.newBuilder().build(); + ListModelsResponse expectedResponse = + ListModelsResponse.newBuilder() + .setNextPageToken("") + .addAllModels(Arrays.asList(responsesElement)) + .build(); + mockModelService.addResponse(expectedResponse); + + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + + ListModelsPagedResponse pagedListResponse = client.listModels(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getModelsList().get(0), resources.get(0)); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListModelsRequest actualRequest = ((ListModelsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listModelsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]"); + client.listModels(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listModelsTest2() throws Exception { + Model responsesElement = Model.newBuilder().build(); + ListModelsResponse expectedResponse = + ListModelsResponse.newBuilder() + .setNextPageToken("") + .addAllModels(Arrays.asList(responsesElement)) + .build(); + mockModelService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListModelsPagedResponse pagedListResponse = client.listModels(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getModelsList().get(0), resources.get(0)); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListModelsRequest actualRequest = ((ListModelsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listModelsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listModels(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateModelTest() throws Exception { + Model expectedResponse = + Model.newBuilder() + .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString()) + .setDisplayName("displayName1714148973") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setType("type3575610") + .setOptimizationObjective("optimizationObjective-1014459828") + .setLastTuneTime(Timestamp.newBuilder().build()) + .setTuningOperation("tuningOperation-1269747150") + .setFilteringOption(RecommendationsFilteringOption.forNumber(0)) + .addAllServingConfigLists(new ArrayList()) + .build(); + mockModelService.addResponse(expectedResponse); + + Model model = Model.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Model actualResponse = client.updateModel(model, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateModelRequest actualRequest = ((UpdateModelRequest) actualRequests.get(0)); + + Assert.assertEquals(model, actualRequest.getModel()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void updateModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + Model model = Model.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateModel(model, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void tuneModelTest() throws Exception { + TuneModelResponse expectedResponse = TuneModelResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("tuneModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockModelService.addResponse(resultOperation); + + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + + TuneModelResponse actualResponse = client.tuneModelAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TuneModelRequest actualRequest = ((TuneModelRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void tuneModelExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]"); + client.tuneModelAsync(name).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()); + } + } + + @Test + public void tuneModelTest2() throws Exception { + TuneModelResponse expectedResponse = TuneModelResponse.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("tuneModelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockModelService.addResponse(resultOperation); + + String name = "name3373707"; + + TuneModelResponse actualResponse = client.tuneModelAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockModelService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TuneModelRequest actualRequest = ((TuneModelRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void tuneModelExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockModelService.addException(exception); + + try { + String name = "name3373707"; + client.tuneModelAsync(name).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/ProductServiceClientHttpJsonTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ProductServiceClientHttpJsonTest.java index ae36ae72182c..7c05980df3be 100644 --- a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ProductServiceClientHttpJsonTest.java +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ProductServiceClientHttpJsonTest.java @@ -120,6 +120,7 @@ public void createProductTest() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -198,6 +199,7 @@ public void createProductTest2() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -278,6 +280,7 @@ public void getProductTest() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -354,6 +357,7 @@ public void getProductTest2() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -532,6 +536,7 @@ public void updateProductTest() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -568,6 +573,7 @@ public void updateProductTest() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -630,6 +636,7 @@ public void updateProductExceptionTest() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); client.updateProduct(product, updateMask); @@ -834,6 +841,7 @@ public void setInventoryTest() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); FieldMask setMask = FieldMask.newBuilder().build(); @@ -896,6 +904,7 @@ public void setInventoryExceptionTest() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); FieldMask setMask = FieldMask.newBuilder().build(); client.setInventoryAsync(inventory, setMask).get(); diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ProductServiceClientTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ProductServiceClientTest.java index 0ad296bdc1bb..ffa71b16b881 100644 --- a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ProductServiceClientTest.java +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ProductServiceClientTest.java @@ -124,6 +124,7 @@ public void createProductTest() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); mockProductService.addResponse(expectedResponse); @@ -198,6 +199,7 @@ public void createProductTest2() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); mockProductService.addResponse(expectedResponse); @@ -272,6 +274,7 @@ public void getProductTest() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); mockProductService.addResponse(expectedResponse); @@ -342,6 +345,7 @@ public void getProductTest2() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); mockProductService.addResponse(expectedResponse); @@ -498,6 +502,7 @@ public void updateProductTest() throws Exception { .setPublishTime(Timestamp.newBuilder().build()) .setRetrievableFields(FieldMask.newBuilder().build()) .addAllVariants(new ArrayList()) + .addAllLocalInventories(new ArrayList()) .build(); mockProductService.addResponse(expectedResponse); diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientHttpJsonTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientHttpJsonTest.java index 218b82d1a8ca..4dc5d570b9c6 100644 --- a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientHttpJsonTest.java +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientHttpJsonTest.java @@ -100,6 +100,7 @@ public void createServingConfigTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -167,6 +168,7 @@ public void createServingConfigTest2() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -318,6 +320,7 @@ public void updateServingConfigTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -342,6 +345,7 @@ public void updateServingConfigTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -392,6 +396,7 @@ public void updateServingConfigExceptionTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -424,6 +429,7 @@ public void getServingConfigTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -488,6 +494,7 @@ public void getServingConfigTest2() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -652,6 +659,7 @@ public void addControlTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -716,6 +724,7 @@ public void addControlTest2() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -780,6 +789,7 @@ public void removeControlTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockService.addResponse(expectedResponse); @@ -844,6 +854,7 @@ public void removeControlTest2() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockService.addResponse(expectedResponse); diff --git a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientTest.java b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientTest.java index 0a94358695a0..1a4f0ed7d0ce 100644 --- a/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientTest.java +++ b/java-retail/google-cloud-retail/src/test/java/com/google/cloud/retail/v2beta/ServingConfigServiceClientTest.java @@ -103,6 +103,7 @@ public void createServingConfigTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockServingConfigService.addResponse(expectedResponse); @@ -166,6 +167,7 @@ public void createServingConfigTest2() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockServingConfigService.addResponse(expectedResponse); @@ -299,6 +301,7 @@ public void updateServingConfigTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockServingConfigService.addResponse(expectedResponse); @@ -358,6 +361,7 @@ public void getServingConfigTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockServingConfigService.addResponse(expectedResponse); @@ -416,6 +420,7 @@ public void getServingConfigTest2() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockServingConfigService.addResponse(expectedResponse); @@ -560,6 +565,7 @@ public void addControlTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockServingConfigService.addResponse(expectedResponse); @@ -618,6 +624,7 @@ public void addControlTest2() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockServingConfigService.addResponse(expectedResponse); @@ -674,6 +681,7 @@ public void removeControlTest() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockServingConfigService.addResponse(expectedResponse); @@ -732,6 +740,7 @@ public void removeControlTest2() throws Exception { .addAllIgnoreControlIds(new ArrayList()) .setDiversityLevel("diversityLevel578206123") .setEnableCategoryFilterLevel("enableCategoryFilterLevel-1232535413") + .setPersonalizationSpec(SearchRequest.PersonalizationSpec.newBuilder().build()) .addAllSolutionTypes(new ArrayList()) .build(); mockServingConfigService.addResponse(expectedResponse); diff --git a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceGrpc.java b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceGrpc.java index 6765f04f392d..7c5a62e5fb4d 100644 --- a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceGrpc.java +++ b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceGrpc.java @@ -509,6 +509,59 @@ private CatalogServiceGrpc() {} return getRemoveCatalogAttributeMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest, + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse> + getBatchRemoveCatalogAttributesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "BatchRemoveCatalogAttributes", + requestType = com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest.class, + responseType = com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest, + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse> + getBatchRemoveCatalogAttributesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest, + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse> + getBatchRemoveCatalogAttributesMethod; + if ((getBatchRemoveCatalogAttributesMethod = + CatalogServiceGrpc.getBatchRemoveCatalogAttributesMethod) + == null) { + synchronized (CatalogServiceGrpc.class) { + if ((getBatchRemoveCatalogAttributesMethod = + CatalogServiceGrpc.getBatchRemoveCatalogAttributesMethod) + == null) { + CatalogServiceGrpc.getBatchRemoveCatalogAttributesMethod = + getBatchRemoveCatalogAttributesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "BatchRemoveCatalogAttributes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CatalogServiceMethodDescriptorSupplier( + "BatchRemoveCatalogAttributes")) + .build(); + } + } + } + return getBatchRemoveCatalogAttributesMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest, com.google.cloud.retail.v2beta.AttributesConfig> @@ -802,6 +855,24 @@ public void removeCatalogAttribute( getRemoveCatalogAttributeMethod(), responseObserver); } + /** + * + * + *
+     * Removes all specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s from the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * 
+ */ + public void batchRemoveCatalogAttributes( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getBatchRemoveCatalogAttributesMethod(), responseObserver); + } + /** * * @@ -894,6 +965,13 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.retail.v2beta.RemoveCatalogAttributeRequest, com.google.cloud.retail.v2beta.AttributesConfig>( this, METHODID_REMOVE_CATALOG_ATTRIBUTE))) + .addMethod( + getBatchRemoveCatalogAttributesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest, + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse>( + this, METHODID_BATCH_REMOVE_CATALOG_ATTRIBUTES))) .addMethod( getReplaceCatalogAttributeMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -1137,6 +1215,26 @@ public void removeCatalogAttribute( responseObserver); } + /** + * + * + *
+     * Removes all specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s from the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * 
+ */ + public void batchRemoveCatalogAttributes( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getBatchRemoveCatalogAttributesMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1356,6 +1454,22 @@ public com.google.cloud.retail.v2beta.AttributesConfig removeCatalogAttribute( getChannel(), getRemoveCatalogAttributeMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Removes all specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s from the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * 
+ */ + public com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse + batchRemoveCatalogAttributes( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBatchRemoveCatalogAttributesMethod(), getCallOptions(), request); + } + /** * * @@ -1583,6 +1697,23 @@ protected CatalogServiceFutureStub build( getChannel().newCall(getRemoveCatalogAttributeMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Removes all specified
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s from the
+     * [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse> + batchRemoveCatalogAttributes( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getBatchRemoveCatalogAttributesMethod(), getCallOptions()), request); + } + /** * * @@ -1615,7 +1746,8 @@ protected CatalogServiceFutureStub build( private static final int METHODID_UPDATE_ATTRIBUTES_CONFIG = 7; private static final int METHODID_ADD_CATALOG_ATTRIBUTE = 8; private static final int METHODID_REMOVE_CATALOG_ATTRIBUTE = 9; - private static final int METHODID_REPLACE_CATALOG_ATTRIBUTE = 10; + private static final int METHODID_BATCH_REMOVE_CATALOG_ATTRIBUTES = 10; + private static final int METHODID_REPLACE_CATALOG_ATTRIBUTE = 11; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1693,6 +1825,13 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_BATCH_REMOVE_CATALOG_ATTRIBUTES: + serviceImpl.batchRemoveCatalogAttributes( + (com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse>) + responseObserver); + break; case METHODID_REPLACE_CATALOG_ATTRIBUTE: serviceImpl.replaceCatalogAttribute( (com.google.cloud.retail.v2beta.ReplaceCatalogAttributeRequest) request, @@ -1773,6 +1912,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getUpdateAttributesConfigMethod()) .addMethod(getAddCatalogAttributeMethod()) .addMethod(getRemoveCatalogAttributeMethod()) + .addMethod(getBatchRemoveCatalogAttributesMethod()) .addMethod(getReplaceCatalogAttributeMethod()) .build(); } diff --git a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceGrpc.java b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceGrpc.java index 4141ea3c3706..4fad4d0eb07e 100644 --- a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceGrpc.java +++ b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CompletionServiceGrpc.java @@ -23,7 +23,7 @@ *
  * Auto-completion service for retail.
  * This feature is only available for users who have Retail Search enabled.
- * Please enable Retail Search on Cloud Console before using this feature.
+ * Enable Retail Search on Cloud Console before using this feature.
  * 
*/ @javax.annotation.Generated( @@ -180,7 +180,7 @@ public CompletionServiceFutureStub newStub( *
    * Auto-completion service for retail.
    * This feature is only available for users who have Retail Search enabled.
-   * Please enable Retail Search on Cloud Console before using this feature.
+   * Enable Retail Search on Cloud Console before using this feature.
    * 
*/ public abstract static class CompletionServiceImplBase implements io.grpc.BindableService { @@ -191,7 +191,7 @@ public abstract static class CompletionServiceImplBase implements io.grpc.Bindab *
      * Completes the specified prefix with keyword suggestions.
      * This feature is only available for users who have Retail Search enabled.
-     * Please enable Retail Search on Cloud Console before using this feature.
+     * Enable Retail Search on Cloud Console before using this feature.
      * 
*/ public void completeQuery( @@ -211,7 +211,7 @@ public void completeQuery( * The operation is successfully finished only after the imported suggestions * are indexed successfully and ready for serving. The process takes hours. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void importCompletionData( @@ -247,7 +247,7 @@ public final io.grpc.ServerServiceDefinition bindService() { *
    * Auto-completion service for retail.
    * This feature is only available for users who have Retail Search enabled.
-   * Please enable Retail Search on Cloud Console before using this feature.
+   * Enable Retail Search on Cloud Console before using this feature.
    * 
*/ public static final class CompletionServiceStub @@ -268,7 +268,7 @@ protected CompletionServiceStub build( *
      * Completes the specified prefix with keyword suggestions.
      * This feature is only available for users who have Retail Search enabled.
-     * Please enable Retail Search on Cloud Console before using this feature.
+     * Enable Retail Search on Cloud Console before using this feature.
      * 
*/ public void completeQuery( @@ -290,7 +290,7 @@ public void completeQuery( * The operation is successfully finished only after the imported suggestions * are indexed successfully and ready for serving. The process takes hours. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void importCompletionData( @@ -309,7 +309,7 @@ public void importCompletionData( *
    * Auto-completion service for retail.
    * This feature is only available for users who have Retail Search enabled.
-   * Please enable Retail Search on Cloud Console before using this feature.
+   * Enable Retail Search on Cloud Console before using this feature.
    * 
*/ public static final class CompletionServiceBlockingStub @@ -331,7 +331,7 @@ protected CompletionServiceBlockingStub build( *
      * Completes the specified prefix with keyword suggestions.
      * This feature is only available for users who have Retail Search enabled.
-     * Please enable Retail Search on Cloud Console before using this feature.
+     * Enable Retail Search on Cloud Console before using this feature.
      * 
*/ public com.google.cloud.retail.v2beta.CompleteQueryResponse completeQuery( @@ -349,7 +349,7 @@ public com.google.cloud.retail.v2beta.CompleteQueryResponse completeQuery( * The operation is successfully finished only after the imported suggestions * are indexed successfully and ready for serving. The process takes hours. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.longrunning.Operation importCompletionData( @@ -365,7 +365,7 @@ public com.google.longrunning.Operation importCompletionData( *
    * Auto-completion service for retail.
    * This feature is only available for users who have Retail Search enabled.
-   * Please enable Retail Search on Cloud Console before using this feature.
+   * Enable Retail Search on Cloud Console before using this feature.
    * 
*/ public static final class CompletionServiceFutureStub @@ -386,7 +386,7 @@ protected CompletionServiceFutureStub build( *
      * Completes the specified prefix with keyword suggestions.
      * This feature is only available for users who have Retail Search enabled.
-     * Please enable Retail Search on Cloud Console before using this feature.
+     * Enable Retail Search on Cloud Console before using this feature.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< @@ -405,7 +405,7 @@ protected CompletionServiceFutureStub build( * The operation is successfully finished only after the imported suggestions * are indexed successfully and ready for serving. The process takes hours. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.common.util.concurrent.ListenableFuture diff --git a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceGrpc.java b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceGrpc.java index 940e6394b83b..1e517559fd3d 100644 --- a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceGrpc.java +++ b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlServiceGrpc.java @@ -349,7 +349,7 @@ public void deleteControl( * 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 delete does not exist, a + * [Control][google.cloud.retail.v2beta.Control] to update does not exist, a * NOT_FOUND error is returned. * */ @@ -377,7 +377,8 @@ public void getControl( * * *
-     * Lists all Controls linked to this catalog.
+     * Lists all Controls by their parent
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
      * 
*/ public void listControls( @@ -487,7 +488,7 @@ public void deleteControl( * 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 delete does not exist, a + * [Control][google.cloud.retail.v2beta.Control] to update does not exist, a * NOT_FOUND error is returned. * */ @@ -518,7 +519,8 @@ public void getControl( * * *
-     * Lists all Controls linked to this catalog.
+     * Lists all Controls by their parent
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
      * 
*/ public void listControls( @@ -588,7 +590,7 @@ public com.google.protobuf.Empty deleteControl( * 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 delete does not exist, a + * [Control][google.cloud.retail.v2beta.Control] to update does not exist, a * NOT_FOUND error is returned. * */ @@ -615,7 +617,8 @@ public com.google.cloud.retail.v2beta.Control getControl( * * *
-     * Lists all Controls linked to this catalog.
+     * Lists all Controls by their parent
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
      * 
*/ public com.google.cloud.retail.v2beta.ListControlsResponse listControls( @@ -682,7 +685,7 @@ protected ControlServiceFutureStub build( * 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 delete does not exist, a + * [Control][google.cloud.retail.v2beta.Control] to update does not exist, a * NOT_FOUND error is returned. * */ @@ -711,7 +714,8 @@ protected ControlServiceFutureStub build( * * *
-     * Lists all Controls linked to this catalog.
+     * Lists all Controls by their parent
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< diff --git a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelServiceGrpc.java b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelServiceGrpc.java new file mode 100644 index 000000000000..171c2bf4aa2a --- /dev/null +++ b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelServiceGrpc.java @@ -0,0 +1,1075 @@ +/* + * Copyright 2020 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 performing CRUD operations on models.
+ * Recommendation models contain all the metadata necessary to generate a set of
+ * models for the `Predict()` API. A model is queried
+ * indirectly via a ServingConfig, which associates a model with a
+ * given Placement (e.g. Frequently Bought Together on Home Page).
+ * This service allows you to do the following:
+ * * Initiate training of a model.
+ * * Pause training of an existing model.
+ * * List all the available models along with their metadata.
+ * * Control their tuning schedule.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/retail/v2beta/model_service.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class ModelServiceGrpc { + + private ModelServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.retail.v2beta.ModelService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateModelRequest, com.google.longrunning.Operation> + getCreateModelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateModel", + requestType = com.google.cloud.retail.v2beta.CreateModelRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateModelRequest, com.google.longrunning.Operation> + getCreateModelMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.CreateModelRequest, com.google.longrunning.Operation> + getCreateModelMethod; + if ((getCreateModelMethod = ModelServiceGrpc.getCreateModelMethod) == null) { + synchronized (ModelServiceGrpc.class) { + if ((getCreateModelMethod = ModelServiceGrpc.getCreateModelMethod) == null) { + ModelServiceGrpc.getCreateModelMethod = + getCreateModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.CreateModelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("CreateModel")) + .build(); + } + } + } + return getCreateModelMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.PauseModelRequest, com.google.cloud.retail.v2beta.Model> + getPauseModelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PauseModel", + requestType = com.google.cloud.retail.v2beta.PauseModelRequest.class, + responseType = com.google.cloud.retail.v2beta.Model.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.PauseModelRequest, com.google.cloud.retail.v2beta.Model> + getPauseModelMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.PauseModelRequest, com.google.cloud.retail.v2beta.Model> + getPauseModelMethod; + if ((getPauseModelMethod = ModelServiceGrpc.getPauseModelMethod) == null) { + synchronized (ModelServiceGrpc.class) { + if ((getPauseModelMethod = ModelServiceGrpc.getPauseModelMethod) == null) { + ModelServiceGrpc.getPauseModelMethod = + getPauseModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PauseModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.PauseModelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.Model.getDefaultInstance())) + .setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("PauseModel")) + .build(); + } + } + } + return getPauseModelMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ResumeModelRequest, com.google.cloud.retail.v2beta.Model> + getResumeModelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ResumeModel", + requestType = com.google.cloud.retail.v2beta.ResumeModelRequest.class, + responseType = com.google.cloud.retail.v2beta.Model.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ResumeModelRequest, com.google.cloud.retail.v2beta.Model> + getResumeModelMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ResumeModelRequest, com.google.cloud.retail.v2beta.Model> + getResumeModelMethod; + if ((getResumeModelMethod = ModelServiceGrpc.getResumeModelMethod) == null) { + synchronized (ModelServiceGrpc.class) { + if ((getResumeModelMethod = ModelServiceGrpc.getResumeModelMethod) == null) { + ModelServiceGrpc.getResumeModelMethod = + getResumeModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ResumeModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ResumeModelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.Model.getDefaultInstance())) + .setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("ResumeModel")) + .build(); + } + } + } + return getResumeModelMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteModelRequest, com.google.protobuf.Empty> + getDeleteModelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteModel", + requestType = com.google.cloud.retail.v2beta.DeleteModelRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteModelRequest, com.google.protobuf.Empty> + getDeleteModelMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.DeleteModelRequest, com.google.protobuf.Empty> + getDeleteModelMethod; + if ((getDeleteModelMethod = ModelServiceGrpc.getDeleteModelMethod) == null) { + synchronized (ModelServiceGrpc.class) { + if ((getDeleteModelMethod = ModelServiceGrpc.getDeleteModelMethod) == null) { + ModelServiceGrpc.getDeleteModelMethod = + getDeleteModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.DeleteModelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("DeleteModel")) + .build(); + } + } + } + return getDeleteModelMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListModelsRequest, + com.google.cloud.retail.v2beta.ListModelsResponse> + getListModelsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListModels", + requestType = com.google.cloud.retail.v2beta.ListModelsRequest.class, + responseType = com.google.cloud.retail.v2beta.ListModelsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListModelsRequest, + com.google.cloud.retail.v2beta.ListModelsResponse> + getListModelsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.ListModelsRequest, + com.google.cloud.retail.v2beta.ListModelsResponse> + getListModelsMethod; + if ((getListModelsMethod = ModelServiceGrpc.getListModelsMethod) == null) { + synchronized (ModelServiceGrpc.class) { + if ((getListModelsMethod = ModelServiceGrpc.getListModelsMethod) == null) { + ModelServiceGrpc.getListModelsMethod = + getListModelsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListModels")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ListModelsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.ListModelsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("ListModels")) + .build(); + } + } + } + return getListModelsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateModelRequest, com.google.cloud.retail.v2beta.Model> + getUpdateModelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateModel", + requestType = com.google.cloud.retail.v2beta.UpdateModelRequest.class, + responseType = com.google.cloud.retail.v2beta.Model.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateModelRequest, com.google.cloud.retail.v2beta.Model> + getUpdateModelMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.UpdateModelRequest, com.google.cloud.retail.v2beta.Model> + getUpdateModelMethod; + if ((getUpdateModelMethod = ModelServiceGrpc.getUpdateModelMethod) == null) { + synchronized (ModelServiceGrpc.class) { + if ((getUpdateModelMethod = ModelServiceGrpc.getUpdateModelMethod) == null) { + ModelServiceGrpc.getUpdateModelMethod = + getUpdateModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.UpdateModelRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.Model.getDefaultInstance())) + .setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("UpdateModel")) + .build(); + } + } + } + return getUpdateModelMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.TuneModelRequest, com.google.longrunning.Operation> + getTuneModelMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TuneModel", + requestType = com.google.cloud.retail.v2beta.TuneModelRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.TuneModelRequest, com.google.longrunning.Operation> + getTuneModelMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.retail.v2beta.TuneModelRequest, com.google.longrunning.Operation> + getTuneModelMethod; + if ((getTuneModelMethod = ModelServiceGrpc.getTuneModelMethod) == null) { + synchronized (ModelServiceGrpc.class) { + if ((getTuneModelMethod = ModelServiceGrpc.getTuneModelMethod) == null) { + ModelServiceGrpc.getTuneModelMethod = + getTuneModelMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TuneModel")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.retail.v2beta.TuneModelRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new ModelServiceMethodDescriptorSupplier("TuneModel")) + .build(); + } + } + } + return getTuneModelMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ModelServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ModelServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ModelServiceStub(channel, callOptions); + } + }; + return ModelServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ModelServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ModelServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ModelServiceBlockingStub(channel, callOptions); + } + }; + return ModelServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ModelServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ModelServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ModelServiceFutureStub(channel, callOptions); + } + }; + return ModelServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Service for performing CRUD operations on models.
+   * Recommendation models contain all the metadata necessary to generate a set of
+   * models for the `Predict()` API. A model is queried
+   * indirectly via a ServingConfig, which associates a model with a
+   * given Placement (e.g. Frequently Bought Together on Home Page).
+   * This service allows you to do the following:
+   * * Initiate training of a model.
+   * * Pause training of an existing model.
+   * * List all the available models along with their metadata.
+   * * Control their tuning schedule.
+   * 
+ */ + public abstract static class ModelServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a new model.
+     * 
+ */ + public void createModel( + com.google.cloud.retail.v2beta.CreateModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateModelMethod(), responseObserver); + } + + /** + * + * + *
+     * Pauses the training of an existing model.
+     * 
+ */ + public void pauseModel( + com.google.cloud.retail.v2beta.PauseModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPauseModelMethod(), responseObserver); + } + + /** + * + * + *
+     * Resumes the training of an existing model.
+     * 
+ */ + public void resumeModel( + com.google.cloud.retail.v2beta.ResumeModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getResumeModelMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes an existing model.
+     * 
+ */ + public void deleteModel( + com.google.cloud.retail.v2beta.DeleteModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteModelMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all the models linked to this event store.
+     * 
+ */ + public void listModels( + com.google.cloud.retail.v2beta.ListModelsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListModelsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void updateModel( + com.google.cloud.retail.v2beta.UpdateModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateModelMethod(), responseObserver); + } + + /** + * + * + *
+     * Tunes an existing model.
+     * 
+ */ + public void tuneModel( + com.google.cloud.retail.v2beta.TuneModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getTuneModelMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateModelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.CreateModelRequest, + com.google.longrunning.Operation>(this, METHODID_CREATE_MODEL))) + .addMethod( + getPauseModelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.PauseModelRequest, + com.google.cloud.retail.v2beta.Model>(this, METHODID_PAUSE_MODEL))) + .addMethod( + getResumeModelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.ResumeModelRequest, + com.google.cloud.retail.v2beta.Model>(this, METHODID_RESUME_MODEL))) + .addMethod( + getDeleteModelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.DeleteModelRequest, com.google.protobuf.Empty>( + this, METHODID_DELETE_MODEL))) + .addMethod( + getListModelsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.ListModelsRequest, + com.google.cloud.retail.v2beta.ListModelsResponse>( + this, METHODID_LIST_MODELS))) + .addMethod( + getUpdateModelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.UpdateModelRequest, + com.google.cloud.retail.v2beta.Model>(this, METHODID_UPDATE_MODEL))) + .addMethod( + getTuneModelMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.retail.v2beta.TuneModelRequest, + com.google.longrunning.Operation>(this, METHODID_TUNE_MODEL))) + .build(); + } + } + + /** + * + * + *
+   * Service for performing CRUD operations on models.
+   * Recommendation models contain all the metadata necessary to generate a set of
+   * models for the `Predict()` API. A model is queried
+   * indirectly via a ServingConfig, which associates a model with a
+   * given Placement (e.g. Frequently Bought Together on Home Page).
+   * This service allows you to do the following:
+   * * Initiate training of a model.
+   * * Pause training of an existing model.
+   * * List all the available models along with their metadata.
+   * * Control their tuning schedule.
+   * 
+ */ + public static final class ModelServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private ModelServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ModelServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ModelServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new model.
+     * 
+ */ + public void createModel( + com.google.cloud.retail.v2beta.CreateModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateModelMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Pauses the training of an existing model.
+     * 
+ */ + public void pauseModel( + com.google.cloud.retail.v2beta.PauseModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getPauseModelMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Resumes the training of an existing model.
+     * 
+ */ + public void resumeModel( + com.google.cloud.retail.v2beta.ResumeModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getResumeModelMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes an existing model.
+     * 
+ */ + public void deleteModel( + com.google.cloud.retail.v2beta.DeleteModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteModelMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists all the models linked to this event store.
+     * 
+ */ + public void listModels( + com.google.cloud.retail.v2beta.ListModelsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListModelsMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void updateModel( + com.google.cloud.retail.v2beta.UpdateModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateModelMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Tunes an existing model.
+     * 
+ */ + public void tuneModel( + com.google.cloud.retail.v2beta.TuneModelRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getTuneModelMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + * + * + *
+   * Service for performing CRUD operations on models.
+   * Recommendation models contain all the metadata necessary to generate a set of
+   * models for the `Predict()` API. A model is queried
+   * indirectly via a ServingConfig, which associates a model with a
+   * given Placement (e.g. Frequently Bought Together on Home Page).
+   * This service allows you to do the following:
+   * * Initiate training of a model.
+   * * Pause training of an existing model.
+   * * List all the available models along with their metadata.
+   * * Control their tuning schedule.
+   * 
+ */ + public static final class ModelServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private ModelServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ModelServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ModelServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new model.
+     * 
+ */ + public com.google.longrunning.Operation createModel( + com.google.cloud.retail.v2beta.CreateModelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateModelMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Pauses the training of an existing model.
+     * 
+ */ + public com.google.cloud.retail.v2beta.Model pauseModel( + com.google.cloud.retail.v2beta.PauseModelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPauseModelMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Resumes the training of an existing model.
+     * 
+ */ + public com.google.cloud.retail.v2beta.Model resumeModel( + com.google.cloud.retail.v2beta.ResumeModelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getResumeModelMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an existing model.
+     * 
+ */ + public com.google.protobuf.Empty deleteModel( + com.google.cloud.retail.v2beta.DeleteModelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteModelMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all the models linked to this event store.
+     * 
+ */ + public com.google.cloud.retail.v2beta.ListModelsResponse listModels( + com.google.cloud.retail.v2beta.ListModelsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListModelsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.cloud.retail.v2beta.Model updateModel( + com.google.cloud.retail.v2beta.UpdateModelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateModelMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Tunes an existing model.
+     * 
+ */ + public com.google.longrunning.Operation tuneModel( + com.google.cloud.retail.v2beta.TuneModelRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getTuneModelMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service for performing CRUD operations on models.
+   * Recommendation models contain all the metadata necessary to generate a set of
+   * models for the `Predict()` API. A model is queried
+   * indirectly via a ServingConfig, which associates a model with a
+   * given Placement (e.g. Frequently Bought Together on Home Page).
+   * This service allows you to do the following:
+   * * Initiate training of a model.
+   * * Pause training of an existing model.
+   * * List all the available models along with their metadata.
+   * * Control their tuning schedule.
+   * 
+ */ + public static final class ModelServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private ModelServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ModelServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ModelServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new model.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createModel(com.google.cloud.retail.v2beta.CreateModelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateModelMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Pauses the training of an existing model.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + pauseModel(com.google.cloud.retail.v2beta.PauseModelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPauseModelMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Resumes the training of an existing model.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + resumeModel(com.google.cloud.retail.v2beta.ResumeModelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getResumeModelMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes an existing model.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteModel(com.google.cloud.retail.v2beta.DeleteModelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteModelMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists all the models linked to this event store.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.retail.v2beta.ListModelsResponse> + listModels(com.google.cloud.retail.v2beta.ListModelsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListModelsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateModel(com.google.cloud.retail.v2beta.UpdateModelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateModelMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Tunes an existing model.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + tuneModel(com.google.cloud.retail.v2beta.TuneModelRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getTuneModelMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_MODEL = 0; + private static final int METHODID_PAUSE_MODEL = 1; + private static final int METHODID_RESUME_MODEL = 2; + private static final int METHODID_DELETE_MODEL = 3; + private static final int METHODID_LIST_MODELS = 4; + private static final int METHODID_UPDATE_MODEL = 5; + private static final int METHODID_TUNE_MODEL = 6; + + 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 ModelServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ModelServiceImplBase 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_CREATE_MODEL: + serviceImpl.createModel( + (com.google.cloud.retail.v2beta.CreateModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PAUSE_MODEL: + serviceImpl.pauseModel( + (com.google.cloud.retail.v2beta.PauseModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_RESUME_MODEL: + serviceImpl.resumeModel( + (com.google.cloud.retail.v2beta.ResumeModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_MODEL: + serviceImpl.deleteModel( + (com.google.cloud.retail.v2beta.DeleteModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_MODELS: + serviceImpl.listModels( + (com.google.cloud.retail.v2beta.ListModelsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_MODEL: + serviceImpl.updateModel( + (com.google.cloud.retail.v2beta.UpdateModelRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TUNE_MODEL: + serviceImpl.tuneModel( + (com.google.cloud.retail.v2beta.TuneModelRequest) 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(); + } + } + } + + private abstract static class ModelServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ModelServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ModelService"); + } + } + + private static final class ModelServiceFileDescriptorSupplier + extends ModelServiceBaseDescriptorSupplier { + ModelServiceFileDescriptorSupplier() {} + } + + private static final class ModelServiceMethodDescriptorSupplier + extends ModelServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ModelServiceMethodDescriptorSupplier(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 (ModelServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ModelServiceFileDescriptorSupplier()) + .addMethod(getCreateModelMethod()) + .addMethod(getPauseModelMethod()) + .addMethod(getResumeModelMethod()) + .addMethod(getDeleteModelMethod()) + .addMethod(getListModelsMethod()) + .addMethod(getUpdateModelMethod()) + .addMethod(getTuneModelMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceGrpc.java b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceGrpc.java index 4fb66ba591bc..51be63d83c96 100644 --- a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceGrpc.java +++ b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductServiceGrpc.java @@ -690,9 +690,9 @@ public void importProducts( * 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 will be - * enqueued and processed downstream. As a consequence, when a response is - * returned, updates are not immediately manifested in the + * 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 @@ -701,27 +701,34 @@ public void importProducts( * [ProductService.CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct], - * the specified inventory field value(s) will overwrite any existing value(s) + * the specified inventory field value(s) overwrite any existing value(s) * while ignoring the last update time for this field. Furthermore, the last - * update time for the specified inventory fields will be overwritten to the - * time of the + * 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. * If no inventory fields are set in * [CreateProductRequest.product][google.cloud.retail.v2beta.CreateProductRequest.product], - * then any pre-existing inventory information for this product will be used. + * then any pre-existing inventory information for this product is used. * If no inventory fields are set in * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask], - * then any existing inventory information will be preserved. + * then any existing inventory information is preserved. * Pre-existing inventory information can only be updated with * [ProductService.SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces], * and * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. + * The returned [Operation][google.longrunning.Operation]s is obsolete after + * one day, and the [GetOperation][google.longrunning.Operations.GetOperation] + * API returns `NOT_FOUND` afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates are not marked as [done][google.longrunning.Operation.done] until + * they are obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void setInventory( @@ -746,8 +753,15 @@ public void setInventory( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] * or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void addFulfillmentPlaces( @@ -772,8 +786,15 @@ public void addFulfillmentPlaces( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] * or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void removeFulfillmentPlaces( @@ -804,8 +825,15 @@ public void removeFulfillmentPlaces( * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] * has no effect on local inventories. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void addLocalInventories( @@ -834,8 +862,15 @@ public void addLocalInventories( * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] * has no effect on local inventories. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void removeLocalInventories( @@ -1046,9 +1081,9 @@ public void importProducts( * 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 will be - * enqueued and processed downstream. As a consequence, when a response is - * returned, updates are not immediately manifested in the + * 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 @@ -1057,27 +1092,34 @@ public void importProducts( * [ProductService.CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct], - * the specified inventory field value(s) will overwrite any existing value(s) + * the specified inventory field value(s) overwrite any existing value(s) * while ignoring the last update time for this field. Furthermore, the last - * update time for the specified inventory fields will be overwritten to the - * time of the + * 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. * If no inventory fields are set in * [CreateProductRequest.product][google.cloud.retail.v2beta.CreateProductRequest.product], - * then any pre-existing inventory information for this product will be used. + * then any pre-existing inventory information for this product is used. * If no inventory fields are set in * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask], - * then any existing inventory information will be preserved. + * then any existing inventory information is preserved. * Pre-existing inventory information can only be updated with * [ProductService.SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces], * and * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. + * The returned [Operation][google.longrunning.Operation]s is obsolete after + * one day, and the [GetOperation][google.longrunning.Operations.GetOperation] + * API returns `NOT_FOUND` afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates are not marked as [done][google.longrunning.Operation.done] until + * they are obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void setInventory( @@ -1104,8 +1146,15 @@ public void setInventory( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] * or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void addFulfillmentPlaces( @@ -1132,8 +1181,15 @@ public void addFulfillmentPlaces( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] * or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void removeFulfillmentPlaces( @@ -1166,8 +1222,15 @@ public void removeFulfillmentPlaces( * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] * has no effect on local inventories. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void addLocalInventories( @@ -1198,8 +1261,15 @@ public void addLocalInventories( * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] * has no effect on local inventories. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public void removeLocalInventories( @@ -1323,9 +1393,9 @@ public com.google.longrunning.Operation importProducts( * 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 will be - * enqueued and processed downstream. As a consequence, when a response is - * returned, updates are not immediately manifested in the + * 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 @@ -1334,27 +1404,34 @@ public com.google.longrunning.Operation importProducts( * [ProductService.CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct], - * the specified inventory field value(s) will overwrite any existing value(s) + * the specified inventory field value(s) overwrite any existing value(s) * while ignoring the last update time for this field. Furthermore, the last - * update time for the specified inventory fields will be overwritten to the - * time of the + * 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. * If no inventory fields are set in * [CreateProductRequest.product][google.cloud.retail.v2beta.CreateProductRequest.product], - * then any pre-existing inventory information for this product will be used. + * then any pre-existing inventory information for this product is used. * If no inventory fields are set in * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask], - * then any existing inventory information will be preserved. + * then any existing inventory information is preserved. * Pre-existing inventory information can only be updated with * [ProductService.SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces], * and * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. + * The returned [Operation][google.longrunning.Operation]s is obsolete after + * one day, and the [GetOperation][google.longrunning.Operations.GetOperation] + * API returns `NOT_FOUND` afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates are not marked as [done][google.longrunning.Operation.done] until + * they are obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.longrunning.Operation setInventory( @@ -1378,8 +1455,15 @@ public com.google.longrunning.Operation setInventory( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] * or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.longrunning.Operation addFulfillmentPlaces( @@ -1403,8 +1487,15 @@ public com.google.longrunning.Operation addFulfillmentPlaces( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] * or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.longrunning.Operation removeFulfillmentPlaces( @@ -1434,8 +1525,15 @@ public com.google.longrunning.Operation removeFulfillmentPlaces( * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] * has no effect on local inventories. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.longrunning.Operation addLocalInventories( @@ -1463,8 +1561,15 @@ public com.google.longrunning.Operation addLocalInventories( * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] * has no effect on local inventories. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.longrunning.Operation removeLocalInventories( @@ -1589,9 +1694,9 @@ protected ProductServiceFutureStub build( * 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 will be - * enqueued and processed downstream. As a consequence, when a response is - * returned, updates are not immediately manifested in the + * 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 @@ -1600,27 +1705,34 @@ protected ProductServiceFutureStub build( * [ProductService.CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct] * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct], - * the specified inventory field value(s) will overwrite any existing value(s) + * the specified inventory field value(s) overwrite any existing value(s) * while ignoring the last update time for this field. Furthermore, the last - * update time for the specified inventory fields will be overwritten to the - * time of the + * 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. * If no inventory fields are set in * [CreateProductRequest.product][google.cloud.retail.v2beta.CreateProductRequest.product], - * then any pre-existing inventory information for this product will be used. + * then any pre-existing inventory information for this product is used. * If no inventory fields are set in * [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask], - * then any existing inventory information will be preserved. + * then any existing inventory information is preserved. * Pre-existing inventory information can only be updated with * [ProductService.SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory], * [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.AddFulfillmentPlaces], * and * [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces]. + * The returned [Operation][google.longrunning.Operation]s is obsolete after + * one day, and the [GetOperation][google.longrunning.Operations.GetOperation] + * API returns `NOT_FOUND` afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates are not marked as [done][google.longrunning.Operation.done] until + * they are obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.common.util.concurrent.ListenableFuture @@ -1644,8 +1756,15 @@ protected ProductServiceFutureStub build( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] * or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.common.util.concurrent.ListenableFuture @@ -1669,8 +1788,15 @@ protected ProductServiceFutureStub build( * [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct] * or * [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts]. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.common.util.concurrent.ListenableFuture @@ -1701,8 +1827,15 @@ protected ProductServiceFutureStub build( * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] * has no effect on local inventories. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.common.util.concurrent.ListenableFuture @@ -1730,8 +1863,15 @@ protected ProductServiceFutureStub build( * and * [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct] * has no effect on local inventories. + * The returned [Operation][google.longrunning.Operation]s will be obsolete + * after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] + * API will return NOT_FOUND afterwards. + * If conflicting updates are issued, the + * [Operation][google.longrunning.Operation]s associated with the stale + * updates will not be marked as [done][google.longrunning.Operation.done] + * until being obsolete. * This feature is only available for users who have Retail Search enabled. - * Please enable Retail Search on Cloud Console before using this feature. + * Enable Retail Search on Cloud Console before using this feature. * */ public com.google.common.util.concurrent.ListenableFuture diff --git a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceGrpc.java b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceGrpc.java index e6b9f41d48e3..76d64885cde6 100644 --- a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceGrpc.java +++ b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceGrpc.java @@ -23,7 +23,7 @@ *
  * Service for search.
  * This feature is only available for users who have Retail Search enabled.
- * Please enable Retail Search on Cloud Console before using this feature.
+ * Enable Retail Search on Cloud Console before using this feature.
  * 
*/ @javax.annotation.Generated( @@ -128,7 +128,7 @@ public SearchServiceFutureStub newStub( *
    * Service for search.
    * This feature is only available for users who have Retail Search enabled.
-   * Please enable Retail Search on Cloud Console before using this feature.
+   * Enable Retail Search on Cloud Console before using this feature.
    * 
*/ public abstract static class SearchServiceImplBase implements io.grpc.BindableService { @@ -139,7 +139,7 @@ public abstract static class SearchServiceImplBase implements io.grpc.BindableSe *
      * Performs a search.
      * This feature is only available for users who have Retail Search enabled.
-     * Please enable Retail Search on Cloud Console before using this feature.
+     * Enable Retail Search on Cloud Console before using this feature.
      * 
*/ public void search( @@ -168,7 +168,7 @@ public final io.grpc.ServerServiceDefinition bindService() { *
    * Service for search.
    * This feature is only available for users who have Retail Search enabled.
-   * Please enable Retail Search on Cloud Console before using this feature.
+   * Enable Retail Search on Cloud Console before using this feature.
    * 
*/ public static final class SearchServiceStub @@ -188,7 +188,7 @@ protected SearchServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions c *
      * Performs a search.
      * This feature is only available for users who have Retail Search enabled.
-     * Please enable Retail Search on Cloud Console before using this feature.
+     * Enable Retail Search on Cloud Console before using this feature.
      * 
*/ public void search( @@ -206,7 +206,7 @@ public void search( *
    * Service for search.
    * This feature is only available for users who have Retail Search enabled.
-   * Please enable Retail Search on Cloud Console before using this feature.
+   * Enable Retail Search on Cloud Console before using this feature.
    * 
*/ public static final class SearchServiceBlockingStub @@ -227,7 +227,7 @@ protected SearchServiceBlockingStub build( *
      * Performs a search.
      * This feature is only available for users who have Retail Search enabled.
-     * Please enable Retail Search on Cloud Console before using this feature.
+     * Enable Retail Search on Cloud Console before using this feature.
      * 
*/ public com.google.cloud.retail.v2beta.SearchResponse search( @@ -243,7 +243,7 @@ public com.google.cloud.retail.v2beta.SearchResponse search( *
    * Service for search.
    * This feature is only available for users who have Retail Search enabled.
-   * Please enable Retail Search on Cloud Console before using this feature.
+   * Enable Retail Search on Cloud Console before using this feature.
    * 
*/ public static final class SearchServiceFutureStub @@ -264,7 +264,7 @@ protected SearchServiceFutureStub build( *
      * Performs a search.
      * This feature is only available for users who have Retail Search enabled.
-     * Please enable Retail Search on Cloud Console before using this feature.
+     * Enable Retail Search on Cloud Console before using this feature.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture< diff --git a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceGrpc.java b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceGrpc.java index 167aaef87b43..19433585f10a 100644 --- a/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceGrpc.java +++ b/java-retail/grpc-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceGrpc.java @@ -360,9 +360,9 @@ public void purgeUserEvents( * 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 + * `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. + * `Operation.metadata` is of type `ImportMetadata`. * */ public void importUserEvents( @@ -376,14 +376,14 @@ public void importUserEvents( * * *
-     * Starts a user event rejoin operation with latest product catalog. Events
-     * will not be annotated with detailed product information if product is
-     * missing from the catalog at the time the user event is ingested, and these
-     * events are stored as unjoined events with a limited usage on training and
-     * serving. This method can be used to start a join operation on specified
-     * events with latest version of product catalog. It can also be used to
-     * correct events joined with the wrong product catalog. A rejoin operation
-     * can take hours or days to complete.
+     * 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.
      * 
*/ public void rejoinUserEvents( @@ -509,9 +509,9 @@ public void purgeUserEvents( * 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 + * `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. + * `Operation.metadata` is of type `ImportMetadata`. * */ public void importUserEvents( @@ -527,14 +527,14 @@ public void importUserEvents( * * *
-     * Starts a user event rejoin operation with latest product catalog. Events
-     * will not be annotated with detailed product information if product is
-     * missing from the catalog at the time the user event is ingested, and these
-     * events are stored as unjoined events with a limited usage on training and
-     * serving. This method can be used to start a join operation on specified
-     * events with latest version of product catalog. It can also be used to
-     * correct events joined with the wrong product catalog. A rejoin operation
-     * can take hours or days to complete.
+     * 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.
      * 
*/ public void rejoinUserEvents( @@ -618,9 +618,9 @@ public com.google.longrunning.Operation purgeUserEvents( * 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 + * `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. + * `Operation.metadata` is of type `ImportMetadata`. * */ public com.google.longrunning.Operation importUserEvents( @@ -633,14 +633,14 @@ public com.google.longrunning.Operation importUserEvents( * * *
-     * Starts a user event rejoin operation with latest product catalog. Events
-     * will not be annotated with detailed product information if product is
-     * missing from the catalog at the time the user event is ingested, and these
-     * events are stored as unjoined events with a limited usage on training and
-     * serving. This method can be used to start a join operation on specified
-     * events with latest version of product catalog. It can also be used to
-     * correct events joined with the wrong product catalog. A rejoin operation
-     * can take hours or days to complete.
+     * 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.
      * 
*/ public com.google.longrunning.Operation rejoinUserEvents( @@ -722,9 +722,9 @@ protected UserEventServiceFutureStub build( * 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 + * `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. + * `Operation.metadata` is of type `ImportMetadata`. * */ public com.google.common.util.concurrent.ListenableFuture @@ -737,14 +737,14 @@ protected UserEventServiceFutureStub build( * * *
-     * Starts a user event rejoin operation with latest product catalog. Events
-     * will not be annotated with detailed product information if product is
-     * missing from the catalog at the time the user event is ingested, and these
-     * events are stored as unjoined events with a limited usage on training and
-     * serving. This method can be used to start a join operation on specified
-     * events with latest version of product catalog. It can also be used to
-     * correct events joined with the wrong product catalog. A rejoin operation
-     * can take hours or days to complete.
+     * 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.
      * 
*/ public com.google.common.util.concurrent.ListenableFuture diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequest.java index 0909a27f661f..c07f788708b5 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequest.java @@ -128,7 +128,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The source ServingConfig resource name . Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -154,7 +154,7 @@ public java.lang.String getServingConfig() { * *
    * Required. The source ServingConfig resource name . Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -566,7 +566,7 @@ public Builder mergeFrom( * *
      * Required. The source ServingConfig resource name . Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -591,7 +591,7 @@ public java.lang.String getServingConfig() { * *
      * Required. The source ServingConfig resource name . Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -616,7 +616,7 @@ public com.google.protobuf.ByteString getServingConfigBytes() { * *
      * Required. The source ServingConfig resource name . Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -640,7 +640,7 @@ public Builder setServingConfig(java.lang.String value) { * *
      * Required. The source ServingConfig resource name . Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -660,7 +660,7 @@ public Builder clearServingConfig() { * *
      * Required. The source ServingConfig resource name . Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequestOrBuilder.java index 870921a00978..f4f79cf01dc5 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/AddControlRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface AddControlRequestOrBuilder * *
    * Required. The source ServingConfig resource name . Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -43,7 +43,7 @@ public interface AddControlRequestOrBuilder * *
    * Required. The source ServingConfig resource name . Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesRequest.java new file mode 100644 index 000000000000..256ad24a070f --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesRequest.java @@ -0,0 +1,990 @@ +/* + * Copyright 2020 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/catalog_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for
+ * [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2beta.CatalogService.BatchRemoveCatalogAttributes]
+ * method.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest} + */ +public final class BatchRemoveCatalogAttributesRequest + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest) + BatchRemoveCatalogAttributesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchRemoveCatalogAttributesRequest.newBuilder() to construct. + private BatchRemoveCatalogAttributesRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchRemoveCatalogAttributesRequest() { + attributesConfig_ = ""; + attributeKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchRemoveCatalogAttributesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchRemoveCatalogAttributesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + attributesConfig_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + attributeKeys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + attributeKeys_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + attributeKeys_ = attributeKeys_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest.class, + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest.Builder.class); + } + + public static final int ATTRIBUTES_CONFIG_FIELD_NUMBER = 1; + private volatile java.lang.Object attributesConfig_; + /** + * + * + *
+   * Required. The attributes config resource shared by all catalog attributes
+   * being deleted. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
+   * 
+ * + * + * string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The attributesConfig. + */ + @java.lang.Override + public java.lang.String getAttributesConfig() { + java.lang.Object ref = attributesConfig_; + 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(); + attributesConfig_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The attributes config resource shared by all catalog attributes
+   * being deleted. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
+   * 
+ * + * + * string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for attributesConfig. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributesConfigBytes() { + java.lang.Object ref = attributesConfig_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributesConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTE_KEYS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList attributeKeys_; + /** + * + * + *
+   * Required. The attribute name keys of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+   * A maximum of 1000 catalog attributes can be deleted in a batch.
+   * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the attributeKeys. + */ + public com.google.protobuf.ProtocolStringList getAttributeKeysList() { + return attributeKeys_; + } + /** + * + * + *
+   * Required. The attribute name keys of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+   * A maximum of 1000 catalog attributes can be deleted in a batch.
+   * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of attributeKeys. + */ + public int getAttributeKeysCount() { + return attributeKeys_.size(); + } + /** + * + * + *
+   * Required. The attribute name keys of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+   * A maximum of 1000 catalog attributes can be deleted in a batch.
+   * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The attributeKeys at the given index. + */ + public java.lang.String getAttributeKeys(int index) { + return attributeKeys_.get(index); + } + /** + * + * + *
+   * Required. The attribute name keys of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+   * A maximum of 1000 catalog attributes can be deleted in a batch.
+   * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the attributeKeys at the given index. + */ + public com.google.protobuf.ByteString getAttributeKeysBytes(int index) { + return attributeKeys_.getByteString(index); + } + + 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(attributesConfig_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attributesConfig_); + } + for (int i = 0; i < attributeKeys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, attributeKeys_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attributesConfig_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, attributesConfig_); + } + { + int dataSize = 0; + for (int i = 0; i < attributeKeys_.size(); i++) { + dataSize += computeStringSizeNoTag(attributeKeys_.getRaw(i)); + } + size += dataSize; + size += 1 * getAttributeKeysList().size(); + } + size += unknownFields.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.BatchRemoveCatalogAttributesRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest other = + (com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest) obj; + + if (!getAttributesConfig().equals(other.getAttributesConfig())) return false; + if (!getAttributeKeysList().equals(other.getAttributeKeysList())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + ATTRIBUTES_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAttributesConfig().hashCode(); + if (getAttributeKeysCount() > 0) { + hash = (37 * hash) + ATTRIBUTE_KEYS_FIELD_NUMBER; + hash = (53 * hash) + getAttributeKeysList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest 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.BatchRemoveCatalogAttributesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest 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.BatchRemoveCatalogAttributesRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest 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.BatchRemoveCatalogAttributesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest 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.BatchRemoveCatalogAttributesRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest + 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.BatchRemoveCatalogAttributesRequest 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.BatchRemoveCatalogAttributesRequest 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.BatchRemoveCatalogAttributesRequest 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 for
+   * [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2beta.CatalogService.BatchRemoveCatalogAttributes]
+   * method.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest) + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest.class, + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + attributesConfig_ = ""; + + attributeKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest build() { + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest buildPartial() { + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest result = + new com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest(this); + int from_bitField0_ = bitField0_; + result.attributesConfig_ = attributesConfig_; + if (((bitField0_ & 0x00000001) != 0)) { + attributeKeys_ = attributeKeys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.attributeKeys_ = attributeKeys_; + onBuilt(); + return result; + } + + @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.BatchRemoveCatalogAttributesRequest) { + return mergeFrom( + (com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest other) { + if (other + == com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest + .getDefaultInstance()) return this; + if (!other.getAttributesConfig().isEmpty()) { + attributesConfig_ = other.attributesConfig_; + onChanged(); + } + if (!other.attributeKeys_.isEmpty()) { + if (attributeKeys_.isEmpty()) { + attributeKeys_ = other.attributeKeys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAttributeKeysIsMutable(); + attributeKeys_.addAll(other.attributeKeys_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object attributesConfig_ = ""; + /** + * + * + *
+     * Required. The attributes config resource shared by all catalog attributes
+     * being deleted. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
+     * 
+ * + * + * string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The attributesConfig. + */ + public java.lang.String getAttributesConfig() { + java.lang.Object ref = attributesConfig_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attributesConfig_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The attributes config resource shared by all catalog attributes
+     * being deleted. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
+     * 
+ * + * + * string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for attributesConfig. + */ + public com.google.protobuf.ByteString getAttributesConfigBytes() { + java.lang.Object ref = attributesConfig_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attributesConfig_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The attributes config resource shared by all catalog attributes
+     * being deleted. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
+     * 
+ * + * + * string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The attributesConfig to set. + * @return This builder for chaining. + */ + public Builder setAttributesConfig(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attributesConfig_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attributes config resource shared by all catalog attributes
+     * being deleted. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
+     * 
+ * + * + * string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearAttributesConfig() { + + attributesConfig_ = getDefaultInstance().getAttributesConfig(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attributes config resource shared by all catalog attributes
+     * being deleted. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
+     * 
+ * + * + * string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for attributesConfig to set. + * @return This builder for chaining. + */ + public Builder setAttributesConfigBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attributesConfig_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList attributeKeys_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAttributeKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + attributeKeys_ = new com.google.protobuf.LazyStringArrayList(attributeKeys_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. The attribute name keys of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+     * A maximum of 1000 catalog attributes can be deleted in a batch.
+     * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the attributeKeys. + */ + public com.google.protobuf.ProtocolStringList getAttributeKeysList() { + return attributeKeys_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. The attribute name keys of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+     * A maximum of 1000 catalog attributes can be deleted in a batch.
+     * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of attributeKeys. + */ + public int getAttributeKeysCount() { + return attributeKeys_.size(); + } + /** + * + * + *
+     * Required. The attribute name keys of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+     * A maximum of 1000 catalog attributes can be deleted in a batch.
+     * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The attributeKeys at the given index. + */ + public java.lang.String getAttributeKeys(int index) { + return attributeKeys_.get(index); + } + /** + * + * + *
+     * Required. The attribute name keys of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+     * A maximum of 1000 catalog attributes can be deleted in a batch.
+     * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the attributeKeys at the given index. + */ + public com.google.protobuf.ByteString getAttributeKeysBytes(int index) { + return attributeKeys_.getByteString(index); + } + /** + * + * + *
+     * Required. The attribute name keys of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+     * A maximum of 1000 catalog attributes can be deleted in a batch.
+     * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The attributeKeys to set. + * @return This builder for chaining. + */ + public Builder setAttributeKeys(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributeKeysIsMutable(); + attributeKeys_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute name keys of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+     * A maximum of 1000 catalog attributes can be deleted in a batch.
+     * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The attributeKeys to add. + * @return This builder for chaining. + */ + public Builder addAttributeKeys(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAttributeKeysIsMutable(); + attributeKeys_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute name keys of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+     * A maximum of 1000 catalog attributes can be deleted in a batch.
+     * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The attributeKeys to add. + * @return This builder for chaining. + */ + public Builder addAllAttributeKeys(java.lang.Iterable values) { + ensureAttributeKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, attributeKeys_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute name keys of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+     * A maximum of 1000 catalog attributes can be deleted in a batch.
+     * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAttributeKeys() { + attributeKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The attribute name keys of the
+     * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+     * A maximum of 1000 catalog attributes can be deleted in a batch.
+     * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the attributeKeys to add. + * @return This builder for chaining. + */ + public Builder addAttributeKeysBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAttributeKeysIsMutable(); + attributeKeys_.add(value); + 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.BatchRemoveCatalogAttributesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest) + private static final com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest(); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchRemoveCatalogAttributesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchRemoveCatalogAttributesRequest(input, extensionRegistry); + } + }; + + 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.BatchRemoveCatalogAttributesRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesRequestOrBuilder.java new file mode 100644 index 000000000000..fe6af39de097 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesRequestOrBuilder.java @@ -0,0 +1,117 @@ +/* + * Copyright 2020 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/catalog_service.proto + +package com.google.cloud.retail.v2beta; + +public interface BatchRemoveCatalogAttributesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The attributes config resource shared by all catalog attributes
+   * being deleted. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
+   * 
+ * + * + * string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The attributesConfig. + */ + java.lang.String getAttributesConfig(); + /** + * + * + *
+   * Required. The attributes config resource shared by all catalog attributes
+   * being deleted. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
+   * 
+ * + * + * string attributes_config = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for attributesConfig. + */ + com.google.protobuf.ByteString getAttributesConfigBytes(); + + /** + * + * + *
+   * Required. The attribute name keys of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+   * A maximum of 1000 catalog attributes can be deleted in a batch.
+   * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the attributeKeys. + */ + java.util.List getAttributeKeysList(); + /** + * + * + *
+   * Required. The attribute name keys of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+   * A maximum of 1000 catalog attributes can be deleted in a batch.
+   * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of attributeKeys. + */ + int getAttributeKeysCount(); + /** + * + * + *
+   * Required. The attribute name keys of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+   * A maximum of 1000 catalog attributes can be deleted in a batch.
+   * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The attributeKeys at the given index. + */ + java.lang.String getAttributeKeys(int index); + /** + * + * + *
+   * Required. The attribute name keys of the
+   * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+   * A maximum of 1000 catalog attributes can be deleted in a batch.
+   * 
+ * + * repeated string attribute_keys = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the attributeKeys at the given index. + */ + com.google.protobuf.ByteString getAttributeKeysBytes(int index); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesResponse.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesResponse.java new file mode 100644 index 000000000000..045066692519 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesResponse.java @@ -0,0 +1,1076 @@ +/* + * Copyright 2020 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/catalog_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response of the
+ * [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2beta.CatalogService.BatchRemoveCatalogAttributes].
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse} + */ +public final class BatchRemoveCatalogAttributesResponse + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse) + BatchRemoveCatalogAttributesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use BatchRemoveCatalogAttributesResponse.newBuilder() to construct. + private BatchRemoveCatalogAttributesResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BatchRemoveCatalogAttributesResponse() { + deletedCatalogAttributes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + resetCatalogAttributes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchRemoveCatalogAttributesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BatchRemoveCatalogAttributesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + deletedCatalogAttributes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + deletedCatalogAttributes_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + resetCatalogAttributes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + resetCatalogAttributes_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + deletedCatalogAttributes_ = deletedCatalogAttributes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + resetCatalogAttributes_ = resetCatalogAttributes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse.class, + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse.Builder.class); + } + + public static final int DELETED_CATALOG_ATTRIBUTES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList deletedCatalogAttributes_; + /** + * + * + *
+   * Catalog attributes that were deleted. Only attributes that are not [in
+   * use][CatalogAttribute.in_use] by products can be deleted.
+   * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @return A list containing the deletedCatalogAttributes. + */ + public com.google.protobuf.ProtocolStringList getDeletedCatalogAttributesList() { + return deletedCatalogAttributes_; + } + /** + * + * + *
+   * Catalog attributes that were deleted. Only attributes that are not [in
+   * use][CatalogAttribute.in_use] by products can be deleted.
+   * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @return The count of deletedCatalogAttributes. + */ + public int getDeletedCatalogAttributesCount() { + return deletedCatalogAttributes_.size(); + } + /** + * + * + *
+   * Catalog attributes that were deleted. Only attributes that are not [in
+   * use][CatalogAttribute.in_use] by products can be deleted.
+   * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @param index The index of the element to return. + * @return The deletedCatalogAttributes at the given index. + */ + public java.lang.String getDeletedCatalogAttributes(int index) { + return deletedCatalogAttributes_.get(index); + } + /** + * + * + *
+   * Catalog attributes that were deleted. Only attributes that are not [in
+   * use][CatalogAttribute.in_use] by products can be deleted.
+   * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @param index The index of the value to return. + * @return The bytes of the deletedCatalogAttributes at the given index. + */ + public com.google.protobuf.ByteString getDeletedCatalogAttributesBytes(int index) { + return deletedCatalogAttributes_.getByteString(index); + } + + public static final int RESET_CATALOG_ATTRIBUTES_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList resetCatalogAttributes_; + /** + * + * + *
+   * Catalog attributes that were reset. Attributes that are [in
+   * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+   * configuration properties will reset to default values upon removal request.
+   * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @return A list containing the resetCatalogAttributes. + */ + public com.google.protobuf.ProtocolStringList getResetCatalogAttributesList() { + return resetCatalogAttributes_; + } + /** + * + * + *
+   * Catalog attributes that were reset. Attributes that are [in
+   * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+   * configuration properties will reset to default values upon removal request.
+   * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @return The count of resetCatalogAttributes. + */ + public int getResetCatalogAttributesCount() { + return resetCatalogAttributes_.size(); + } + /** + * + * + *
+   * Catalog attributes that were reset. Attributes that are [in
+   * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+   * configuration properties will reset to default values upon removal request.
+   * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @param index The index of the element to return. + * @return The resetCatalogAttributes at the given index. + */ + public java.lang.String getResetCatalogAttributes(int index) { + return resetCatalogAttributes_.get(index); + } + /** + * + * + *
+   * Catalog attributes that were reset. Attributes that are [in
+   * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+   * configuration properties will reset to default values upon removal request.
+   * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @param index The index of the value to return. + * @return The bytes of the resetCatalogAttributes at the given index. + */ + public com.google.protobuf.ByteString getResetCatalogAttributesBytes(int index) { + return resetCatalogAttributes_.getByteString(index); + } + + 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 < deletedCatalogAttributes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 1, deletedCatalogAttributes_.getRaw(i)); + } + for (int i = 0; i < resetCatalogAttributes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 2, resetCatalogAttributes_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < deletedCatalogAttributes_.size(); i++) { + dataSize += computeStringSizeNoTag(deletedCatalogAttributes_.getRaw(i)); + } + size += dataSize; + size += 1 * getDeletedCatalogAttributesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < resetCatalogAttributes_.size(); i++) { + dataSize += computeStringSizeNoTag(resetCatalogAttributes_.getRaw(i)); + } + size += dataSize; + size += 1 * getResetCatalogAttributesList().size(); + } + size += unknownFields.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.BatchRemoveCatalogAttributesResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse other = + (com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse) obj; + + if (!getDeletedCatalogAttributesList().equals(other.getDeletedCatalogAttributesList())) + return false; + if (!getResetCatalogAttributesList().equals(other.getResetCatalogAttributesList())) + return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDeletedCatalogAttributesCount() > 0) { + hash = (37 * hash) + DELETED_CATALOG_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getDeletedCatalogAttributesList().hashCode(); + } + if (getResetCatalogAttributesCount() > 0) { + hash = (37 * hash) + RESET_CATALOG_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getResetCatalogAttributesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse 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.BatchRemoveCatalogAttributesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse 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.BatchRemoveCatalogAttributesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse 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.BatchRemoveCatalogAttributesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse 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.BatchRemoveCatalogAttributesResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse + 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.BatchRemoveCatalogAttributesResponse 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.BatchRemoveCatalogAttributesResponse 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.BatchRemoveCatalogAttributesResponse 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
+   * [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2beta.CatalogService.BatchRemoveCatalogAttributes].
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse) + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse.class, + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse.Builder.class); + } + + // Construct using + // com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + deletedCatalogAttributes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + resetCatalogAttributes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.CatalogServiceProto + .internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse + getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse build() { + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse buildPartial() { + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse result = + new com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + deletedCatalogAttributes_ = deletedCatalogAttributes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.deletedCatalogAttributes_ = deletedCatalogAttributes_; + if (((bitField0_ & 0x00000002) != 0)) { + resetCatalogAttributes_ = resetCatalogAttributes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.resetCatalogAttributes_ = resetCatalogAttributes_; + onBuilt(); + return result; + } + + @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.BatchRemoveCatalogAttributesResponse) { + return mergeFrom( + (com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse other) { + if (other + == com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse + .getDefaultInstance()) return this; + if (!other.deletedCatalogAttributes_.isEmpty()) { + if (deletedCatalogAttributes_.isEmpty()) { + deletedCatalogAttributes_ = other.deletedCatalogAttributes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDeletedCatalogAttributesIsMutable(); + deletedCatalogAttributes_.addAll(other.deletedCatalogAttributes_); + } + onChanged(); + } + if (!other.resetCatalogAttributes_.isEmpty()) { + if (resetCatalogAttributes_.isEmpty()) { + resetCatalogAttributes_ = other.resetCatalogAttributes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureResetCatalogAttributesIsMutable(); + resetCatalogAttributes_.addAll(other.resetCatalogAttributes_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList deletedCatalogAttributes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureDeletedCatalogAttributesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + deletedCatalogAttributes_ = + new com.google.protobuf.LazyStringArrayList(deletedCatalogAttributes_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Catalog attributes that were deleted. Only attributes that are not [in
+     * use][CatalogAttribute.in_use] by products can be deleted.
+     * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @return A list containing the deletedCatalogAttributes. + */ + public com.google.protobuf.ProtocolStringList getDeletedCatalogAttributesList() { + return deletedCatalogAttributes_.getUnmodifiableView(); + } + /** + * + * + *
+     * Catalog attributes that were deleted. Only attributes that are not [in
+     * use][CatalogAttribute.in_use] by products can be deleted.
+     * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @return The count of deletedCatalogAttributes. + */ + public int getDeletedCatalogAttributesCount() { + return deletedCatalogAttributes_.size(); + } + /** + * + * + *
+     * Catalog attributes that were deleted. Only attributes that are not [in
+     * use][CatalogAttribute.in_use] by products can be deleted.
+     * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @param index The index of the element to return. + * @return The deletedCatalogAttributes at the given index. + */ + public java.lang.String getDeletedCatalogAttributes(int index) { + return deletedCatalogAttributes_.get(index); + } + /** + * + * + *
+     * Catalog attributes that were deleted. Only attributes that are not [in
+     * use][CatalogAttribute.in_use] by products can be deleted.
+     * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @param index The index of the value to return. + * @return The bytes of the deletedCatalogAttributes at the given index. + */ + public com.google.protobuf.ByteString getDeletedCatalogAttributesBytes(int index) { + return deletedCatalogAttributes_.getByteString(index); + } + /** + * + * + *
+     * Catalog attributes that were deleted. Only attributes that are not [in
+     * use][CatalogAttribute.in_use] by products can be deleted.
+     * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @param index The index to set the value at. + * @param value The deletedCatalogAttributes to set. + * @return This builder for chaining. + */ + public Builder setDeletedCatalogAttributes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeletedCatalogAttributesIsMutable(); + deletedCatalogAttributes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Catalog attributes that were deleted. Only attributes that are not [in
+     * use][CatalogAttribute.in_use] by products can be deleted.
+     * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @param value The deletedCatalogAttributes to add. + * @return This builder for chaining. + */ + public Builder addDeletedCatalogAttributes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDeletedCatalogAttributesIsMutable(); + deletedCatalogAttributes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Catalog attributes that were deleted. Only attributes that are not [in
+     * use][CatalogAttribute.in_use] by products can be deleted.
+     * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @param values The deletedCatalogAttributes to add. + * @return This builder for chaining. + */ + public Builder addAllDeletedCatalogAttributes(java.lang.Iterable values) { + ensureDeletedCatalogAttributesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, deletedCatalogAttributes_); + onChanged(); + return this; + } + /** + * + * + *
+     * Catalog attributes that were deleted. Only attributes that are not [in
+     * use][CatalogAttribute.in_use] by products can be deleted.
+     * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @return This builder for chaining. + */ + public Builder clearDeletedCatalogAttributes() { + deletedCatalogAttributes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Catalog attributes that were deleted. Only attributes that are not [in
+     * use][CatalogAttribute.in_use] by products can be deleted.
+     * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @param value The bytes of the deletedCatalogAttributes to add. + * @return This builder for chaining. + */ + public Builder addDeletedCatalogAttributesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureDeletedCatalogAttributesIsMutable(); + deletedCatalogAttributes_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList resetCatalogAttributes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureResetCatalogAttributesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + resetCatalogAttributes_ = + new com.google.protobuf.LazyStringArrayList(resetCatalogAttributes_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Catalog attributes that were reset. Attributes that are [in
+     * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+     * configuration properties will reset to default values upon removal request.
+     * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @return A list containing the resetCatalogAttributes. + */ + public com.google.protobuf.ProtocolStringList getResetCatalogAttributesList() { + return resetCatalogAttributes_.getUnmodifiableView(); + } + /** + * + * + *
+     * Catalog attributes that were reset. Attributes that are [in
+     * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+     * configuration properties will reset to default values upon removal request.
+     * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @return The count of resetCatalogAttributes. + */ + public int getResetCatalogAttributesCount() { + return resetCatalogAttributes_.size(); + } + /** + * + * + *
+     * Catalog attributes that were reset. Attributes that are [in
+     * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+     * configuration properties will reset to default values upon removal request.
+     * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @param index The index of the element to return. + * @return The resetCatalogAttributes at the given index. + */ + public java.lang.String getResetCatalogAttributes(int index) { + return resetCatalogAttributes_.get(index); + } + /** + * + * + *
+     * Catalog attributes that were reset. Attributes that are [in
+     * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+     * configuration properties will reset to default values upon removal request.
+     * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @param index The index of the value to return. + * @return The bytes of the resetCatalogAttributes at the given index. + */ + public com.google.protobuf.ByteString getResetCatalogAttributesBytes(int index) { + return resetCatalogAttributes_.getByteString(index); + } + /** + * + * + *
+     * Catalog attributes that were reset. Attributes that are [in
+     * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+     * configuration properties will reset to default values upon removal request.
+     * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @param index The index to set the value at. + * @param value The resetCatalogAttributes to set. + * @return This builder for chaining. + */ + public Builder setResetCatalogAttributes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResetCatalogAttributesIsMutable(); + resetCatalogAttributes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Catalog attributes that were reset. Attributes that are [in
+     * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+     * configuration properties will reset to default values upon removal request.
+     * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @param value The resetCatalogAttributes to add. + * @return This builder for chaining. + */ + public Builder addResetCatalogAttributes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResetCatalogAttributesIsMutable(); + resetCatalogAttributes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Catalog attributes that were reset. Attributes that are [in
+     * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+     * configuration properties will reset to default values upon removal request.
+     * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @param values The resetCatalogAttributes to add. + * @return This builder for chaining. + */ + public Builder addAllResetCatalogAttributes(java.lang.Iterable values) { + ensureResetCatalogAttributesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, resetCatalogAttributes_); + onChanged(); + return this; + } + /** + * + * + *
+     * Catalog attributes that were reset. Attributes that are [in
+     * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+     * configuration properties will reset to default values upon removal request.
+     * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @return This builder for chaining. + */ + public Builder clearResetCatalogAttributes() { + resetCatalogAttributes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Catalog attributes that were reset. Attributes that are [in
+     * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+     * configuration properties will reset to default values upon removal request.
+     * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @param value The bytes of the resetCatalogAttributes to add. + * @return This builder for chaining. + */ + public Builder addResetCatalogAttributesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResetCatalogAttributesIsMutable(); + resetCatalogAttributes_.add(value); + 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.BatchRemoveCatalogAttributesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse) + private static final com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse(); + } + + public static com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchRemoveCatalogAttributesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchRemoveCatalogAttributesResponse(input, extensionRegistry); + } + }; + + 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.BatchRemoveCatalogAttributesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesResponseOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesResponseOrBuilder.java new file mode 100644 index 000000000000..4e42b8983d53 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BatchRemoveCatalogAttributesResponseOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2020 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/catalog_service.proto + +package com.google.cloud.retail.v2beta; + +public interface BatchRemoveCatalogAttributesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Catalog attributes that were deleted. Only attributes that are not [in
+   * use][CatalogAttribute.in_use] by products can be deleted.
+   * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @return A list containing the deletedCatalogAttributes. + */ + java.util.List getDeletedCatalogAttributesList(); + /** + * + * + *
+   * Catalog attributes that were deleted. Only attributes that are not [in
+   * use][CatalogAttribute.in_use] by products can be deleted.
+   * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @return The count of deletedCatalogAttributes. + */ + int getDeletedCatalogAttributesCount(); + /** + * + * + *
+   * Catalog attributes that were deleted. Only attributes that are not [in
+   * use][CatalogAttribute.in_use] by products can be deleted.
+   * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @param index The index of the element to return. + * @return The deletedCatalogAttributes at the given index. + */ + java.lang.String getDeletedCatalogAttributes(int index); + /** + * + * + *
+   * Catalog attributes that were deleted. Only attributes that are not [in
+   * use][CatalogAttribute.in_use] by products can be deleted.
+   * 
+ * + * repeated string deleted_catalog_attributes = 1; + * + * @param index The index of the value to return. + * @return The bytes of the deletedCatalogAttributes at the given index. + */ + com.google.protobuf.ByteString getDeletedCatalogAttributesBytes(int index); + + /** + * + * + *
+   * Catalog attributes that were reset. Attributes that are [in
+   * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+   * configuration properties will reset to default values upon removal request.
+   * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @return A list containing the resetCatalogAttributes. + */ + java.util.List getResetCatalogAttributesList(); + /** + * + * + *
+   * Catalog attributes that were reset. Attributes that are [in
+   * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+   * configuration properties will reset to default values upon removal request.
+   * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @return The count of resetCatalogAttributes. + */ + int getResetCatalogAttributesCount(); + /** + * + * + *
+   * Catalog attributes that were reset. Attributes that are [in
+   * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+   * configuration properties will reset to default values upon removal request.
+   * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @param index The index of the element to return. + * @return The resetCatalogAttributes at the given index. + */ + java.lang.String getResetCatalogAttributes(int index); + /** + * + * + *
+   * Catalog attributes that were reset. Attributes that are [in
+   * use][CatalogAttribute.in_use] by products cannot be deleted, however their
+   * configuration properties will reset to default values upon removal request.
+   * 
+ * + * repeated string reset_catalog_attributes = 2; + * + * @param index The index of the value to return. + * @return The bytes of the resetCatalogAttributes at the given index. + */ + com.google.protobuf.ByteString getResetCatalogAttributesBytes(int index); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySource.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySource.java index a34a5b26dfbf..abdb9435ae40 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySource.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySource.java @@ -209,9 +209,8 @@ public PartitionCase getPartitionCase() { * *
    * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-   * Only supported when
-   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-   * is set to `FULL`.
+   * Only supported in
+   * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
    * 
* * .google.type.Date partition_date = 6; @@ -227,9 +226,8 @@ public boolean hasPartitionDate() { * *
    * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-   * Only supported when
-   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-   * is set to `FULL`.
+   * Only supported in
+   * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
    * 
* * .google.type.Date partition_date = 6; @@ -248,9 +246,8 @@ public com.google.type.Date getPartitionDate() { * *
    * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-   * Only supported when
-   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-   * is set to `FULL`.
+   * Only supported in
+   * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
    * 
* * .google.type.Date partition_date = 6; @@ -490,8 +487,7 @@ public com.google.protobuf.ByteString getGcsStagingDirBytes() { * * `user_event_ga360`: * The schema is available here: * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: This feature is in private preview. Please contact the - * support team for importing Google Analytics 4 events. + * * `user_event_ga4`: * The schema is available here: * https://support.google.com/analytics/answer/7029846. * Supported values for auto-completion imports: @@ -533,8 +529,7 @@ public java.lang.String getDataSchema() { * * `user_event_ga360`: * The schema is available here: * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: This feature is in private preview. Please contact the - * support team for importing Google Analytics 4 events. + * * `user_event_ga4`: * The schema is available here: * https://support.google.com/analytics/answer/7029846. * Supported values for auto-completion imports: @@ -1007,9 +1002,8 @@ public Builder clearPartition() { * *
      * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Only supported in
+     * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
      * 
* * .google.type.Date partition_date = 6; @@ -1025,9 +1019,8 @@ public boolean hasPartitionDate() { * *
      * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Only supported in
+     * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
      * 
* * .google.type.Date partition_date = 6; @@ -1053,9 +1046,8 @@ public com.google.type.Date getPartitionDate() { * *
      * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Only supported in
+     * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
      * 
* * .google.type.Date partition_date = 6; @@ -1078,9 +1070,8 @@ public Builder setPartitionDate(com.google.type.Date value) { * *
      * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Only supported in
+     * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
      * 
* * .google.type.Date partition_date = 6; @@ -1100,9 +1091,8 @@ public Builder setPartitionDate(com.google.type.Date.Builder builderForValue) { * *
      * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Only supported in
+     * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
      * 
* * .google.type.Date partition_date = 6; @@ -1133,9 +1123,8 @@ public Builder mergePartitionDate(com.google.type.Date value) { * *
      * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Only supported in
+     * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
      * 
* * .google.type.Date partition_date = 6; @@ -1161,9 +1150,8 @@ public Builder clearPartitionDate() { * *
      * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Only supported in
+     * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
      * 
* * .google.type.Date partition_date = 6; @@ -1176,9 +1164,8 @@ public com.google.type.Date.Builder getPartitionDateBuilder() { * *
      * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Only supported in
+     * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
      * 
* * .google.type.Date partition_date = 6; @@ -1199,9 +1186,8 @@ public com.google.type.DateOrBuilder getPartitionDateOrBuilder() { * *
      * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Only supported in
+     * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
      * 
* * .google.type.Date partition_date = 6; @@ -1697,8 +1683,7 @@ public Builder setGcsStagingDirBytes(com.google.protobuf.ByteString value) { * * `user_event_ga360`: * The schema is available here: * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: This feature is in private preview. Please contact the - * support team for importing Google Analytics 4 events. + * * `user_event_ga4`: * The schema is available here: * https://support.google.com/analytics/answer/7029846. * Supported values for auto-completion imports: @@ -1739,8 +1724,7 @@ public java.lang.String getDataSchema() { * * `user_event_ga360`: * The schema is available here: * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: This feature is in private preview. Please contact the - * support team for importing Google Analytics 4 events. + * * `user_event_ga4`: * The schema is available here: * https://support.google.com/analytics/answer/7029846. * Supported values for auto-completion imports: @@ -1781,8 +1765,7 @@ public com.google.protobuf.ByteString getDataSchemaBytes() { * * `user_event_ga360`: * The schema is available here: * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: This feature is in private preview. Please contact the - * support team for importing Google Analytics 4 events. + * * `user_event_ga4`: * The schema is available here: * https://support.google.com/analytics/answer/7029846. * Supported values for auto-completion imports: @@ -1822,8 +1805,7 @@ public Builder setDataSchema(java.lang.String value) { * * `user_event_ga360`: * The schema is available here: * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: This feature is in private preview. Please contact the - * support team for importing Google Analytics 4 events. + * * `user_event_ga4`: * The schema is available here: * https://support.google.com/analytics/answer/7029846. * Supported values for auto-completion imports: @@ -1859,8 +1841,7 @@ public Builder clearDataSchema() { * * `user_event_ga360`: * The schema is available here: * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: This feature is in private preview. Please contact the - * support team for importing Google Analytics 4 events. + * * `user_event_ga4`: * The schema is available here: * https://support.google.com/analytics/answer/7029846. * Supported values for auto-completion imports: diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySourceOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySourceOrBuilder.java index 79ab5181df15..fab8abeef966 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySourceOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/BigQuerySourceOrBuilder.java @@ -28,9 +28,8 @@ public interface BigQuerySourceOrBuilder * *
    * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-   * Only supported when
-   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-   * is set to `FULL`.
+   * Only supported in
+   * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
    * 
* * .google.type.Date partition_date = 6; @@ -43,9 +42,8 @@ public interface BigQuerySourceOrBuilder * *
    * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-   * Only supported when
-   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-   * is set to `FULL`.
+   * Only supported in
+   * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
    * 
* * .google.type.Date partition_date = 6; @@ -58,9 +56,8 @@ public interface BigQuerySourceOrBuilder * *
    * BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
-   * Only supported when
-   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-   * is set to `FULL`.
+   * Only supported in
+   * [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
    * 
* * .google.type.Date partition_date = 6; @@ -196,8 +193,7 @@ public interface BigQuerySourceOrBuilder * * `user_event_ga360`: * The schema is available here: * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: This feature is in private preview. Please contact the - * support team for importing Google Analytics 4 events. + * * `user_event_ga4`: * The schema is available here: * https://support.google.com/analytics/answer/7029846. * Supported values for auto-completion imports: @@ -228,8 +224,7 @@ public interface BigQuerySourceOrBuilder * * `user_event_ga360`: * The schema is available here: * https://support.google.com/analytics/answer/3437719. - * * `user_event_ga4`: This feature is in private preview. Please contact the - * support team for importing Google Analytics 4 events. + * * `user_event_ga4`: * The schema is available here: * https://support.google.com/analytics/answer/7029846. * Supported values for auto-completion imports: diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttribute.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttribute.java index 0f7c2c7c24bb..a72d85c54e63 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttribute.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttribute.java @@ -45,6 +45,7 @@ private CatalogAttribute() { dynamicFacetableOption_ = 0; searchableOption_ = 0; recommendationsFilteringOption_ = 0; + exactSearchableOption_ = 0; } @java.lang.Override @@ -123,6 +124,13 @@ private CatalogAttribute( type_ = rawValue; break; } + case 88: + { + int rawValue = input.readEnum(); + + exactSearchableOption_ = rawValue; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -804,6 +812,168 @@ private SearchableOption(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.CatalogAttribute.SearchableOption) } + /** + * + * + *
+   * The status of the exact-searchable option of a catalog attribute.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption} + */ + public enum ExactSearchableOption implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED].
+     * 
+ * + * EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0; + */ + EXACT_SEARCHABLE_OPTION_UNSPECIFIED(0), + /** + * + * + *
+     * Exact searchable option enabled for an attribute.
+     * 
+ * + * EXACT_SEARCHABLE_ENABLED = 1; + */ + EXACT_SEARCHABLE_ENABLED(1), + /** + * + * + *
+     * Exact searchable option disabled for an attribute.
+     * 
+ * + * EXACT_SEARCHABLE_DISABLED = 2; + */ + EXACT_SEARCHABLE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Value used when unset. Defaults to
+     * [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED].
+     * 
+ * + * EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0; + */ + public static final int EXACT_SEARCHABLE_OPTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Exact searchable option enabled for an attribute.
+     * 
+ * + * EXACT_SEARCHABLE_ENABLED = 1; + */ + public static final int EXACT_SEARCHABLE_ENABLED_VALUE = 1; + /** + * + * + *
+     * Exact searchable option disabled for an attribute.
+     * 
+ * + * EXACT_SEARCHABLE_DISABLED = 2; + */ + public static final int EXACT_SEARCHABLE_DISABLED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExactSearchableOption valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ExactSearchableOption forNumber(int value) { + switch (value) { + case 0: + return EXACT_SEARCHABLE_OPTION_UNSPECIFIED; + case 1: + return EXACT_SEARCHABLE_ENABLED; + case 2: + return EXACT_SEARCHABLE_DISABLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ExactSearchableOption findValueByNumber(int number) { + return ExactSearchableOption.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.retail.v2beta.CatalogAttribute.getDescriptor().getEnumTypes().get(4); + } + + private static final ExactSearchableOption[] VALUES = values(); + + public static ExactSearchableOption valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ExactSearchableOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption) + } + public static final int KEY_FIELD_NUMBER = 1; private volatile java.lang.Object key_; /** @@ -1152,6 +1322,54 @@ public int getRecommendationsFilteringOptionValue() { : result; } + public static final int EXACT_SEARCHABLE_OPTION_FIELD_NUMBER = 11; + private int exactSearchableOption_; + /** + * + * + *
+   * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
+   * This property only applies to textual custom attributes and requires
+   * indexable set to enabled to enable exact-searchable.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + * + * + * @return The enum numeric value on the wire for exactSearchableOption. + */ + @java.lang.Override + public int getExactSearchableOptionValue() { + return exactSearchableOption_; + } + /** + * + * + *
+   * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
+   * This property only applies to textual custom attributes and requires
+   * indexable set to enabled to enable exact-searchable.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + * + * + * @return The exactSearchableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption + getExactSearchableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption result = + com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption.valueOf( + exactSearchableOption_); + return result == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption.UNRECOGNIZED + : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1200,6 +1418,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType.UNKNOWN.getNumber()) { output.writeEnum(10, type_); } + if (exactSearchableOption_ + != com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption + .EXACT_SEARCHABLE_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(11, exactSearchableOption_); + } unknownFields.writeTo(output); } @@ -1244,6 +1468,12 @@ public int getSerializedSize() { != com.google.cloud.retail.v2beta.CatalogAttribute.AttributeType.UNKNOWN.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, type_); } + if (exactSearchableOption_ + != com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption + .EXACT_SEARCHABLE_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, exactSearchableOption_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1267,6 +1497,7 @@ public boolean equals(final java.lang.Object obj) { if (dynamicFacetableOption_ != other.dynamicFacetableOption_) return false; if (searchableOption_ != other.searchableOption_) return false; if (recommendationsFilteringOption_ != other.recommendationsFilteringOption_) return false; + if (exactSearchableOption_ != other.exactSearchableOption_) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -1292,6 +1523,8 @@ public int hashCode() { hash = (53 * hash) + searchableOption_; hash = (37 * hash) + RECOMMENDATIONS_FILTERING_OPTION_FIELD_NUMBER; hash = (53 * hash) + recommendationsFilteringOption_; + hash = (37 * hash) + EXACT_SEARCHABLE_OPTION_FIELD_NUMBER; + hash = (53 * hash) + exactSearchableOption_; hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1452,6 +1685,8 @@ public Builder clear() { recommendationsFilteringOption_ = 0; + exactSearchableOption_ = 0; + return this; } @@ -1486,6 +1721,7 @@ public com.google.cloud.retail.v2beta.CatalogAttribute buildPartial() { result.dynamicFacetableOption_ = dynamicFacetableOption_; result.searchableOption_ = searchableOption_; result.recommendationsFilteringOption_ = recommendationsFilteringOption_; + result.exactSearchableOption_ = exactSearchableOption_; onBuilt(); return result; } @@ -1558,6 +1794,9 @@ public Builder mergeFrom(com.google.cloud.retail.v2beta.CatalogAttribute other) if (other.recommendationsFilteringOption_ != 0) { setRecommendationsFilteringOptionValue(other.getRecommendationsFilteringOptionValue()); } + if (other.exactSearchableOption_ != 0) { + setExactSearchableOptionValue(other.getExactSearchableOptionValue()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -2451,6 +2690,122 @@ public Builder clearRecommendationsFilteringOption() { return this; } + private int exactSearchableOption_ = 0; + /** + * + * + *
+     * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
+     * This property only applies to textual custom attributes and requires
+     * indexable set to enabled to enable exact-searchable.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + * + * + * @return The enum numeric value on the wire for exactSearchableOption. + */ + @java.lang.Override + public int getExactSearchableOptionValue() { + return exactSearchableOption_; + } + /** + * + * + *
+     * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
+     * This property only applies to textual custom attributes and requires
+     * indexable set to enabled to enable exact-searchable.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + * + * + * @param value The enum numeric value on the wire for exactSearchableOption to set. + * @return This builder for chaining. + */ + public Builder setExactSearchableOptionValue(int value) { + + exactSearchableOption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
+     * This property only applies to textual custom attributes and requires
+     * indexable set to enabled to enable exact-searchable.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + * + * + * @return The exactSearchableOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption + getExactSearchableOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption result = + com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption.valueOf( + exactSearchableOption_); + return result == null + ? com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
+     * This property only applies to textual custom attributes and requires
+     * indexable set to enabled to enable exact-searchable.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + * + * + * @param value The exactSearchableOption to set. + * @return This builder for chaining. + */ + public Builder setExactSearchableOption( + com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption value) { + if (value == null) { + throw new NullPointerException(); + } + + exactSearchableOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
+     * This property only applies to textual custom attributes and requires
+     * indexable set to enabled to enable exact-searchable.
+     * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + * + * + * @return This builder for chaining. + */ + public Builder clearExactSearchableOption() { + + exactSearchableOption_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttributeOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttributeOrBuilder.java index 0a1d72b47467..19f81a3b6556 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttributeOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogAttributeOrBuilder.java @@ -273,4 +273,37 @@ public interface CatalogAttributeOrBuilder * @return The recommendationsFilteringOption. */ com.google.cloud.retail.v2beta.RecommendationsFilteringOption getRecommendationsFilteringOption(); + + /** + * + * + *
+   * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
+   * This property only applies to textual custom attributes and requires
+   * indexable set to enabled to enable exact-searchable.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + * + * + * @return The enum numeric value on the wire for exactSearchableOption. + */ + int getExactSearchableOptionValue(); + /** + * + * + *
+   * If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
+   * This property only applies to textual custom attributes and requires
+   * indexable set to enabled to enable exact-searchable.
+   * 
+ * + * + * .google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption exact_searchable_option = 11; + * + * + * @return The exactSearchableOption. + */ + com.google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption getExactSearchableOption(); } diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogProto.java index 61e4ac474c09..2683735a1783 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogProto.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogProto.java @@ -75,7 +75,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ommon.proto\032.google/cloud/retail/v2beta/" + "import_config.proto\"^\n\022ProductLevelConfi" + "g\022\036\n\026ingestion_product_type\030\001 \001(\t\022(\n mer" - + "chant_center_product_id_field\030\002 \001(\t\"\221\007\n\020" + + "chant_center_product_id_field\030\002 \001(\t\"\365\010\n\020" + "CatalogAttribute\022\020\n\003key\030\001 \001(\tB\003\340A\002\022\023\n\006in" + "_use\030\t \001(\010B\003\340A\003\022M\n\004type\030\n \001(\0162:.google.c" + "loud.retail.v2beta.CatalogAttribute.Attr" @@ -88,66 +88,71 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "e.cloud.retail.v2beta.CatalogAttribute.S" + "earchableOption\022d\n recommendations_filte" + "ring_option\030\010 \001(\0162:.google.cloud.retail." - + "v2beta.RecommendationsFilteringOption\"8\n" - + "\rAttributeType\022\013\n\007UNKNOWN\020\000\022\013\n\007TEXTUAL\020\001" - + "\022\r\n\tNUMERICAL\020\002\"b\n\017IndexableOption\022 \n\034IN" - + "DEXABLE_OPTION_UNSPECIFIED\020\000\022\025\n\021INDEXABL" - + "E_ENABLED\020\001\022\026\n\022INDEXABLE_DISABLED\020\002\"\201\001\n\026" - + "DynamicFacetableOption\022(\n$DYNAMIC_FACETA" - + "BLE_OPTION_UNSPECIFIED\020\000\022\035\n\031DYNAMIC_FACE" - + "TABLE_ENABLED\020\001\022\036\n\032DYNAMIC_FACETABLE_DIS" - + "ABLED\020\002\"f\n\020SearchableOption\022!\n\035SEARCHABL" - + "E_OPTION_UNSPECIFIED\020\000\022\026\n\022SEARCHABLE_ENA" - + "BLED\020\001\022\027\n\023SEARCHABLE_DISABLED\020\002\"\302\003\n\020Attr" - + "ibutesConfig\022\024\n\004name\030\001 \001(\tB\006\340A\002\340A\005\022_\n\022ca" - + "talog_attributes\030\002 \003(\0132C.google.cloud.re" - + "tail.v2beta.AttributesConfig.CatalogAttr" - + "ibutesEntry\022U\n\026attribute_config_level\030\003 " - + "\001(\01620.google.cloud.retail.v2beta.Attribu" - + "teConfigLevelB\003\340A\003\032f\n\026CatalogAttributesE" - + "ntry\022\013\n\003key\030\001 \001(\t\022;\n\005value\030\002 \001(\0132,.googl" - + "e.cloud.retail.v2beta.CatalogAttribute:\002" - + "8\001:x\352Au\n&retail.googleapis.com/Attribute" - + "sConfig\022Kprojects/{project}/locations/{l" - + "ocation}/catalogs/{catalog}/attributesCo" - + "nfig\"\245\005\n\020CompletionConfig\022\024\n\004name\030\001 \001(\tB" - + "\006\340A\002\340A\005\022\026\n\016matching_order\030\002 \001(\t\022\027\n\017max_s" - + "uggestions\030\003 \001(\005\022\031\n\021min_prefix_length\030\004 " - + "\001(\005\022\025\n\rauto_learning\030\013 \001(\010\022\\\n\030suggestion" - + "s_input_config\030\005 \001(\01325.google.cloud.reta" - + "il.v2beta.CompletionDataInputConfigB\003\340A\003" - + "\022.\n!last_suggestions_import_operation\030\006 " - + "\001(\tB\003\340A\003\022Y\n\025denylist_input_config\030\007 \001(\0132" - + "5.google.cloud.retail.v2beta.CompletionD" - + "ataInputConfigB\003\340A\003\022+\n\036last_denylist_imp" - + "ort_operation\030\010 \001(\tB\003\340A\003\022Z\n\026allowlist_in" - + "put_config\030\t \001(\01325.google.cloud.retail.v" - + "2beta.CompletionDataInputConfigB\003\340A\003\022,\n\037" - + "last_allowlist_import_operation\030\n \001(\tB\003\340" - + "A\003:x\352Au\n&retail.googleapis.com/Completio" - + "nConfig\022Kprojects/{project}/locations/{l" - + "ocation}/catalogs/{catalog}/completionCo" - + "nfig\"\222\001\n\022MerchantCenterLink\022\'\n\032merchant_" - + "center_account_id\030\001 \001(\003B\003\340A\002\022\021\n\tbranch_i" - + "d\030\002 \001(\t\022\024\n\014destinations\030\003 \003(\t\022\023\n\013region_" - + "code\030\004 \001(\t\022\025\n\rlanguage_code\030\005 \001(\t\"\\\n\033Mer" - + "chantCenterLinkingConfig\022=\n\005links\030\001 \003(\0132" - + "..google.cloud.retail.v2beta.MerchantCen" - + "terLink\"\321\002\n\007Catalog\022\024\n\004name\030\001 \001(\tB\006\340A\002\340A" - + "\005\022\034\n\014display_name\030\002 \001(\tB\006\340A\002\340A\005\022Q\n\024produ" - + "ct_level_config\030\004 \001(\0132..google.cloud.ret" - + "ail.v2beta.ProductLevelConfigB\003\340A\002\022_\n\036me" - + "rchant_center_linking_config\030\006 \001(\01327.goo" - + "gle.cloud.retail.v2beta.MerchantCenterLi" - + "nkingConfig:^\352A[\n\035retail.googleapis.com/" - + "Catalog\022:projects/{project}/locations/{l" - + "ocation}/catalogs/{catalog}B\325\001\n\036com.goog" - + "le.cloud.retail.v2betaB\014CatalogProtoP\001Z@" - + "google.golang.org/genproto/googleapis/cl" - + "oud/retail/v2beta;retail\242\002\006RETAIL\252\002\032Goog" - + "le.Cloud.Retail.V2Beta\312\002\032Google\\Cloud\\Re" - + "tail\\V2beta\352\002\035Google::Cloud::Retail::V2b" - + "etab\006proto3" + + "v2beta.RecommendationsFilteringOption\022c\n" + + "\027exact_searchable_option\030\013 \001(\0162B.google." + + "cloud.retail.v2beta.CatalogAttribute.Exa" + + "ctSearchableOption\"8\n\rAttributeType\022\013\n\007U" + + "NKNOWN\020\000\022\013\n\007TEXTUAL\020\001\022\r\n\tNUMERICAL\020\002\"b\n\017" + + "IndexableOption\022 \n\034INDEXABLE_OPTION_UNSP" + + "ECIFIED\020\000\022\025\n\021INDEXABLE_ENABLED\020\001\022\026\n\022INDE" + + "XABLE_DISABLED\020\002\"\201\001\n\026DynamicFacetableOpt" + + "ion\022(\n$DYNAMIC_FACETABLE_OPTION_UNSPECIF" + + "IED\020\000\022\035\n\031DYNAMIC_FACETABLE_ENABLED\020\001\022\036\n\032" + + "DYNAMIC_FACETABLE_DISABLED\020\002\"f\n\020Searchab" + + "leOption\022!\n\035SEARCHABLE_OPTION_UNSPECIFIE" + + "D\020\000\022\026\n\022SEARCHABLE_ENABLED\020\001\022\027\n\023SEARCHABL" + + "E_DISABLED\020\002\"}\n\025ExactSearchableOption\022\'\n" + + "#EXACT_SEARCHABLE_OPTION_UNSPECIFIED\020\000\022\034" + + "\n\030EXACT_SEARCHABLE_ENABLED\020\001\022\035\n\031EXACT_SE" + + "ARCHABLE_DISABLED\020\002\"\302\003\n\020AttributesConfig" + + "\022\024\n\004name\030\001 \001(\tB\006\340A\002\340A\005\022_\n\022catalog_attrib" + + "utes\030\002 \003(\0132C.google.cloud.retail.v2beta." + + "AttributesConfig.CatalogAttributesEntry\022" + + "U\n\026attribute_config_level\030\003 \001(\01620.google" + + ".cloud.retail.v2beta.AttributeConfigLeve" + + "lB\003\340A\003\032f\n\026CatalogAttributesEntry\022\013\n\003key\030" + + "\001 \001(\t\022;\n\005value\030\002 \001(\0132,.google.cloud.reta" + + "il.v2beta.CatalogAttribute:\0028\001:x\352Au\n&ret" + + "ail.googleapis.com/AttributesConfig\022Kpro" + + "jects/{project}/locations/{location}/cat" + + "alogs/{catalog}/attributesConfig\"\245\005\n\020Com" + + "pletionConfig\022\024\n\004name\030\001 \001(\tB\006\340A\002\340A\005\022\026\n\016m" + + "atching_order\030\002 \001(\t\022\027\n\017max_suggestions\030\003" + + " \001(\005\022\031\n\021min_prefix_length\030\004 \001(\005\022\025\n\rauto_" + + "learning\030\013 \001(\010\022\\\n\030suggestions_input_conf" + + "ig\030\005 \001(\01325.google.cloud.retail.v2beta.Co" + + "mpletionDataInputConfigB\003\340A\003\022.\n!last_sug" + + "gestions_import_operation\030\006 \001(\tB\003\340A\003\022Y\n\025" + + "denylist_input_config\030\007 \001(\01325.google.clo" + + "ud.retail.v2beta.CompletionDataInputConf" + + "igB\003\340A\003\022+\n\036last_denylist_import_operatio" + + "n\030\010 \001(\tB\003\340A\003\022Z\n\026allowlist_input_config\030\t" + + " \001(\01325.google.cloud.retail.v2beta.Comple" + + "tionDataInputConfigB\003\340A\003\022,\n\037last_allowli" + + "st_import_operation\030\n \001(\tB\003\340A\003:x\352Au\n&ret" + + "ail.googleapis.com/CompletionConfig\022Kpro" + + "jects/{project}/locations/{location}/cat" + + "alogs/{catalog}/completionConfig\"\222\001\n\022Mer" + + "chantCenterLink\022\'\n\032merchant_center_accou" + + "nt_id\030\001 \001(\003B\003\340A\002\022\021\n\tbranch_id\030\002 \001(\t\022\024\n\014d" + + "estinations\030\003 \003(\t\022\023\n\013region_code\030\004 \001(\t\022\025" + + "\n\rlanguage_code\030\005 \001(\t\"\\\n\033MerchantCenterL" + + "inkingConfig\022=\n\005links\030\001 \003(\0132..google.clo" + + "ud.retail.v2beta.MerchantCenterLink\"\321\002\n\007" + + "Catalog\022\024\n\004name\030\001 \001(\tB\006\340A\002\340A\005\022\034\n\014display" + + "_name\030\002 \001(\tB\006\340A\002\340A\005\022Q\n\024product_level_con" + + "fig\030\004 \001(\0132..google.cloud.retail.v2beta.P" + + "roductLevelConfigB\003\340A\002\022_\n\036merchant_cente" + + "r_linking_config\030\006 \001(\01327.google.cloud.re" + + "tail.v2beta.MerchantCenterLinkingConfig:" + + "^\352A[\n\035retail.googleapis.com/Catalog\022:pro" + + "jects/{project}/locations/{location}/cat" + + "alogs/{catalog}B\325\001\n\036com.google.cloud.ret" + + "ail.v2betaB\014CatalogProtoP\001Z@google.golan" + + "g.org/genproto/googleapis/cloud/retail/v" + + "2beta;retail\242\002\006RETAIL\252\002\032Google.Cloud.Ret" + + "ail.V2Beta\312\002\032Google\\Cloud\\Retail\\V2beta\352" + + "\002\035Google::Cloud::Retail::V2betab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -179,6 +184,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DynamicFacetableOption", "SearchableOption", "RecommendationsFilteringOption", + "ExactSearchableOption", }); internal_static_google_cloud_retail_v2beta_AttributesConfig_descriptor = getDescriptor().getMessageTypes().get(2); diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceProto.java index 6aff950786ef..c742f900a0a0 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceProto.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CatalogServiceProto.java @@ -75,6 +75,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_retail_v2beta_RemoveCatalogAttributeRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_retail_v2beta_RemoveCatalogAttributeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -135,83 +143,97 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\340A\002\"|\n\035RemoveCatalogAttributeRequest\022I\n\021" + "attributes_config\030\001 \001(\tB.\340A\002\372A(\n&retail." + "googleapis.com/AttributesConfig\022\020\n\003key\030\002" - + " \001(\tB\003\340A\002\"\352\001\n\036ReplaceCatalogAttributeReq" - + "uest\022I\n\021attributes_config\030\001 \001(\tB.\340A\002\372A(\n" - + "&retail.googleapis.com/AttributesConfig\022" - + "L\n\021catalog_attribute\030\002 \001(\0132,.google.clou" - + "d.retail.v2beta.CatalogAttributeB\003\340A\002\022/\n" - + "\013update_mask\030\003 \001(\0132\032.google.protobuf.Fie" - + "ldMask2\227\024\n\016CatalogService\022\264\001\n\014ListCatalo" - + "gs\022/.google.cloud.retail.v2beta.ListCata" - + "logsRequest\0320.google.cloud.retail.v2beta" - + ".ListCatalogsResponse\"A\202\323\344\223\0022\0220/v2beta/{" - + "parent=projects/*/locations/*}/catalogs\332" - + "A\006parent\022\307\001\n\rUpdateCatalog\0220.google.clou" - + "d.retail.v2beta.UpdateCatalogRequest\032#.g" - + "oogle.cloud.retail.v2beta.Catalog\"_\202\323\344\223\002" - + "C28/v2beta/{catalog.name=projects/*/loca" - + "tions/*/catalogs/*}:\007catalog\332A\023catalog,u" - + "pdate_mask\022\272\001\n\020SetDefaultBranch\0223.google" - + ".cloud.retail.v2beta.SetDefaultBranchReq" - + "uest\032\026.google.protobuf.Empty\"Y\202\323\344\223\002I\"D/v" - + "2beta/{catalog=projects/*/locations/*/ca" - + "talogs/*}:setDefaultBranch:\001*\332A\007catalog\022" - + "\325\001\n\020GetDefaultBranch\0223.google.cloud.reta" - + "il.v2beta.GetDefaultBranchRequest\0324.goog" - + "le.cloud.retail.v2beta.GetDefaultBranchR" - + "esponse\"V\202\323\344\223\002F\022D/v2beta/{catalog=projec" - + "ts/*/locations/*/catalogs/*}:getDefaultB" - + "ranch\332A\007catalog\022\315\001\n\023GetCompletionConfig\022" - + "6.google.cloud.retail.v2beta.GetCompleti" - + "onConfigRequest\032,.google.cloud.retail.v2" - + "beta.CompletionConfig\"P\202\323\344\223\002C\022A/v2beta/{" - + "name=projects/*/locations/*/catalogs/*/c" - + "ompletionConfig}\332A\004name\022\222\002\n\026UpdateComple" - + "tionConfig\0229.google.cloud.retail.v2beta." - + "UpdateCompletionConfigRequest\032,.google.c" - + "loud.retail.v2beta.CompletionConfig\"\216\001\202\323" - + "\344\223\002h2S/v2beta/{completion_config.name=pr" - + "ojects/*/locations/*/catalogs/*/completi" - + "onConfig}:\021completion_config\332A\035completio" - + "n_config,update_mask\022\315\001\n\023GetAttributesCo" - + "nfig\0226.google.cloud.retail.v2beta.GetAtt" - + "ributesConfigRequest\032,.google.cloud.reta" - + "il.v2beta.AttributesConfig\"P\202\323\344\223\002C\022A/v2b" - + "eta/{name=projects/*/locations/*/catalog" - + "s/*/attributesConfig}\332A\004name\022\222\002\n\026UpdateA" - + "ttributesConfig\0229.google.cloud.retail.v2" - + "beta.UpdateAttributesConfigRequest\032,.goo" + + " \001(\tB\003\340A\002\"\215\001\n#BatchRemoveCatalogAttribut" + + "esRequest\022I\n\021attributes_config\030\001 \001(\tB.\340A" + + "\002\372A(\n&retail.googleapis.com/AttributesCo" + + "nfig\022\033\n\016attribute_keys\030\002 \003(\tB\003\340A\002\"l\n$Bat" + + "chRemoveCatalogAttributesResponse\022\"\n\032del" + + "eted_catalog_attributes\030\001 \003(\t\022 \n\030reset_c" + + "atalog_attributes\030\002 \003(\t\"\352\001\n\036ReplaceCatal" + + "ogAttributeRequest\022I\n\021attributes_config\030" + + "\001 \001(\tB.\340A\002\372A(\n&retail.googleapis.com/Att" + + "ributesConfig\022L\n\021catalog_attribute\030\002 \001(\013" + + "2,.google.cloud.retail.v2beta.CatalogAtt" + + "ributeB\003\340A\002\022/\n\013update_mask\030\003 \001(\0132\032.googl" + + "e.protobuf.FieldMask2\263\026\n\016CatalogService\022" + + "\264\001\n\014ListCatalogs\022/.google.cloud.retail.v" + + "2beta.ListCatalogsRequest\0320.google.cloud" + + ".retail.v2beta.ListCatalogsResponse\"A\202\323\344" + + "\223\0022\0220/v2beta/{parent=projects/*/location" + + "s/*}/catalogs\332A\006parent\022\307\001\n\rUpdateCatalog" + + "\0220.google.cloud.retail.v2beta.UpdateCata" + + "logRequest\032#.google.cloud.retail.v2beta." + + "Catalog\"_\202\323\344\223\002C28/v2beta/{catalog.name=p" + + "rojects/*/locations/*/catalogs/*}:\007catal" + + "og\332A\023catalog,update_mask\022\272\001\n\020SetDefaultB" + + "ranch\0223.google.cloud.retail.v2beta.SetDe" + + "faultBranchRequest\032\026.google.protobuf.Emp" + + "ty\"Y\202\323\344\223\002I\"D/v2beta/{catalog=projects/*/" + + "locations/*/catalogs/*}:setDefaultBranch" + + ":\001*\332A\007catalog\022\325\001\n\020GetDefaultBranch\0223.goo" + + "gle.cloud.retail.v2beta.GetDefaultBranch" + + "Request\0324.google.cloud.retail.v2beta.Get" + + "DefaultBranchResponse\"V\202\323\344\223\002F\022D/v2beta/{" + + "catalog=projects/*/locations/*/catalogs/" + + "*}:getDefaultBranch\332A\007catalog\022\315\001\n\023GetCom" + + "pletionConfig\0226.google.cloud.retail.v2be" + + "ta.GetCompletionConfigRequest\032,.google.c" + + "loud.retail.v2beta.CompletionConfig\"P\202\323\344" + + "\223\002C\022A/v2beta/{name=projects/*/locations/" + + "*/catalogs/*/completionConfig}\332A\004name\022\222\002" + + "\n\026UpdateCompletionConfig\0229.google.cloud." + + "retail.v2beta.UpdateCompletionConfigRequ" + + "est\032,.google.cloud.retail.v2beta.Complet" + + "ionConfig\"\216\001\202\323\344\223\002h2S/v2beta/{completion_" + + "config.name=projects/*/locations/*/catal" + + "ogs/*/completionConfig}:\021completion_conf" + + "ig\332A\035completion_config,update_mask\022\315\001\n\023G" + + "etAttributesConfig\0226.google.cloud.retail" + + ".v2beta.GetAttributesConfigRequest\032,.goo" + "gle.cloud.retail.v2beta.AttributesConfig" - + "\"\216\001\202\323\344\223\002h2S/v2beta/{attributes_config.na" - + "me=projects/*/locations/*/catalogs/*/att" - + "ributesConfig}:\021attributes_config\332A\035attr" - + "ibutes_config,update_mask\022\352\001\n\023AddCatalog" - + "Attribute\0226.google.cloud.retail.v2beta.A" - + "ddCatalogAttributeRequest\032,.google.cloud" - + ".retail.v2beta.AttributesConfig\"m\202\323\344\223\002g\"" - + "b/v2beta/{attributes_config=projects/*/l" - + "ocations/*/catalogs/*/attributesConfig}:" - + "addCatalogAttribute:\001*\022\363\001\n\026RemoveCatalog" - + "Attribute\0229.google.cloud.retail.v2beta.R" - + "emoveCatalogAttributeRequest\032,.google.cl" - + "oud.retail.v2beta.AttributesConfig\"p\202\323\344\223" - + "\002j\"e/v2beta/{attributes_config=projects/" - + "*/locations/*/catalogs/*/attributesConfi" - + "g}:removeCatalogAttribute:\001*\022\366\001\n\027Replace" - + "CatalogAttribute\022:.google.cloud.retail.v" - + "2beta.ReplaceCatalogAttributeRequest\032,.g" - + "oogle.cloud.retail.v2beta.AttributesConf" - + "ig\"q\202\323\344\223\002k\"f/v2beta/{attributes_config=p" - + "rojects/*/locations/*/catalogs/*/attribu" - + "tesConfig}:replaceCatalogAttribute:\001*\032I\312" - + "A\025retail.googleapis.com\322A.https://www.go" - + "ogleapis.com/auth/cloud-platformB\334\001\n\036com" - + ".google.cloud.retail.v2betaB\023CatalogServ" - + "iceProtoP\001Z@google.golang.org/genproto/g" - + "oogleapis/cloud/retail/v2beta;retail\242\002\006R" - + "ETAIL\252\002\032Google.Cloud.Retail.V2Beta\312\002\032Goo" - + "gle\\Cloud\\Retail\\V2beta\352\002\035Google::Cloud:" - + ":Retail::V2betab\006proto3" + + "\"P\202\323\344\223\002C\022A/v2beta/{name=projects/*/locat" + + "ions/*/catalogs/*/attributesConfig}\332A\004na" + + "me\022\222\002\n\026UpdateAttributesConfig\0229.google.c" + + "loud.retail.v2beta.UpdateAttributesConfi" + + "gRequest\032,.google.cloud.retail.v2beta.At" + + "tributesConfig\"\216\001\202\323\344\223\002h2S/v2beta/{attrib" + + "utes_config.name=projects/*/locations/*/" + + "catalogs/*/attributesConfig}:\021attributes" + + "_config\332A\035attributes_config,update_mask\022" + + "\352\001\n\023AddCatalogAttribute\0226.google.cloud.r" + + "etail.v2beta.AddCatalogAttributeRequest\032" + + ",.google.cloud.retail.v2beta.AttributesC" + + "onfig\"m\202\323\344\223\002g\"b/v2beta/{attributes_confi" + + "g=projects/*/locations/*/catalogs/*/attr" + + "ibutesConfig}:addCatalogAttribute:\001*\022\363\001\n" + + "\026RemoveCatalogAttribute\0229.google.cloud.r" + + "etail.v2beta.RemoveCatalogAttributeReque" + + "st\032,.google.cloud.retail.v2beta.Attribut" + + "esConfig\"p\202\323\344\223\002j\"e/v2beta/{attributes_co" + + "nfig=projects/*/locations/*/catalogs/*/a" + + "ttributesConfig}:removeCatalogAttribute:" + + "\001*\022\231\002\n\034BatchRemoveCatalogAttributes\022?.go" + + "ogle.cloud.retail.v2beta.BatchRemoveCata" + + "logAttributesRequest\032@.google.cloud.reta" + + "il.v2beta.BatchRemoveCatalogAttributesRe" + + "sponse\"v\202\323\344\223\002p\"k/v2beta/{attributes_conf" + + "ig=projects/*/locations/*/catalogs/*/att" + + "ributesConfig}:batchRemoveCatalogAttribu" + + "tes:\001*\022\366\001\n\027ReplaceCatalogAttribute\022:.goo" + + "gle.cloud.retail.v2beta.ReplaceCatalogAt" + + "tributeRequest\032,.google.cloud.retail.v2b" + + "eta.AttributesConfig\"q\202\323\344\223\002k\"f/v2beta/{a" + + "ttributes_config=projects/*/locations/*/" + + "catalogs/*/attributesConfig}:replaceCata" + + "logAttribute:\001*\032I\312A\025retail.googleapis.co" + + "m\322A.https://www.googleapis.com/auth/clou" + + "d-platformB\334\001\n\036com.google.cloud.retail.v" + + "2betaB\023CatalogServiceProtoP\001Z@google.gol" + + "ang.org/genproto/googleapis/cloud/retail" + + "/v2beta;retail\242\002\006RETAIL\252\002\032Google.Cloud.R" + + "etail.V2Beta\312\002\032Google\\Cloud\\Retail\\V2bet" + + "a\352\002\035Google::Cloud::Retail::V2betab\006proto" + + "3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -322,8 +344,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "AttributesConfig", "Key", }); - internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_descriptor = + internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesRequest_descriptor = getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesRequest_descriptor, + new java.lang.String[] { + "AttributesConfig", "AttributeKeys", + }); + internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesResponse_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_BatchRemoveCatalogAttributesResponse_descriptor, + new java.lang.String[] { + "DeletedCatalogAttributes", "ResetCatalogAttributes", + }); + internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_descriptor = + getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_retail_v2beta_ReplaceCatalogAttributeRequest_descriptor, diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Condition.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Condition.java index e5c7150cf87e..17a7612d76f0 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Condition.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Condition.java @@ -158,8 +158,8 @@ public interface QueryTermOrBuilder * Value cannot be empty. * Value can have at most 3 terms if specified as a partial match. Each * space separated string is considered as one term. - * Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not - * allowed for partial match. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. * * * string value = 1; @@ -175,8 +175,8 @@ public interface QueryTermOrBuilder * Value cannot be empty. * Value can have at most 3 terms if specified as a partial match. Each * space separated string is considered as one term. - * Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not - * allowed for partial match. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. * * * string value = 1; @@ -308,8 +308,8 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Value cannot be empty. * Value can have at most 3 terms if specified as a partial match. Each * space separated string is considered as one term. - * Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not - * allowed for partial match. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. * * * string value = 1; @@ -336,8 +336,8 @@ public java.lang.String getValue() { * Value cannot be empty. * Value can have at most 3 terms if specified as a partial match. Each * space separated string is considered as one term. - * Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not - * allowed for partial match. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. * * * string value = 1; @@ -721,8 +721,8 @@ public Builder mergeFrom( * Value cannot be empty. * Value can have at most 3 terms if specified as a partial match. Each * space separated string is considered as one term. - * Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not - * allowed for partial match. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. * * * string value = 1; @@ -748,8 +748,8 @@ public java.lang.String getValue() { * Value cannot be empty. * Value can have at most 3 terms if specified as a partial match. Each * space separated string is considered as one term. - * Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not - * allowed for partial match. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. * * * string value = 1; @@ -775,8 +775,8 @@ public com.google.protobuf.ByteString getValueBytes() { * Value cannot be empty. * Value can have at most 3 terms if specified as a partial match. Each * space separated string is considered as one term. - * Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not - * allowed for partial match. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. * * * string value = 1; @@ -801,8 +801,8 @@ public Builder setValue(java.lang.String value) { * Value cannot be empty. * Value can have at most 3 terms if specified as a partial match. Each * space separated string is considered as one term. - * Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not - * allowed for partial match. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. * * * string value = 1; @@ -823,8 +823,8 @@ public Builder clearValue() { * Value cannot be empty. * Value can have at most 3 terms if specified as a partial match. Each * space separated string is considered as one term. - * Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not - * allowed for partial match. + * For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms + * and not allowed for a partial match. * * * string value = 1; diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Control.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Control.java index bfb23e4ff273..eab0aea41d8c 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Control.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Control.java @@ -22,8 +22,9 @@ * * *
- * Configures dynamic serving time metadata that is used to pre and post
- * process search/recommendation model results.
+ * Configures dynamic metadata that can be linked to a
+ * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] and affect search
+ * or recommendation results at serving time.
  * 
* * Protobuf type {@code google.cloud.retail.v2beta.Control} @@ -43,6 +44,7 @@ private Control() { displayName_ = ""; associatedServingConfigIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; solutionTypes_ = java.util.Collections.emptyList(); + searchSolutionUseCase_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -159,6 +161,31 @@ private Control( input.popLimit(oldLimit); break; } + case 56: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + searchSolutionUseCase_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + searchSolutionUseCase_.add(rawValue); + break; + } + case 58: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + searchSolutionUseCase_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + searchSolutionUseCase_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -181,6 +208,9 @@ private Control( if (((mutable_bitField0_ & 0x00000002) != 0)) { solutionTypes_ = java.util.Collections.unmodifiableList(solutionTypes_); } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + searchSolutionUseCase_ = java.util.Collections.unmodifiableList(searchSolutionUseCase_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -208,6 +238,7 @@ public enum ControlCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { + @java.lang.Deprecated FACET_SPEC(3), RULE(4), CONTROL_NOT_SET(0); @@ -254,13 +285,19 @@ public ControlCase getControlCase() { * *
    * A facet specification to perform faceted search.
+   * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+   * used for creating a control.
    * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * * + * @deprecated google.cloud.retail.v2beta.Control.facet_spec is deprecated. See + * google/cloud/retail/v2beta/control.proto;l=51 * @return Whether the facetSpec field is set. */ @java.lang.Override + @java.lang.Deprecated public boolean hasFacetSpec() { return controlCase_ == 3; } @@ -269,13 +306,19 @@ public boolean hasFacetSpec() { * *
    * A facet specification to perform faceted search.
+   * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+   * used for creating a control.
    * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * * + * @deprecated google.cloud.retail.v2beta.Control.facet_spec is deprecated. See + * google/cloud/retail/v2beta/control.proto;l=51 * @return The facetSpec. */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getFacetSpec() { if (controlCase_ == 3) { return (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_; @@ -287,11 +330,15 @@ public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getFacetSpec() { * *
    * A facet specification to perform faceted search.
+   * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+   * used for creating a control.
    * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder getFacetSpecOrBuilder() { if (controlCase_ == 3) { return (com.google.cloud.retail.v2beta.SearchRequest.FacetSpec) control_; @@ -466,10 +513,13 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { * * *
-   * Output only. List of serving configuration ids that that are associated
-   * with this control. Note the association is managed via the ServingConfig,
-   * this is an output only denormalizeed  view. Assumed to be in the same
-   * catalog.
+   * Output only. List of [serving
+   * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+   * associated with this control in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog].
+   * Note the association is managed via the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+   * output only denormalized view.
    * 
* * @@ -485,10 +535,13 @@ public com.google.protobuf.ProtocolStringList getAssociatedServingConfigIdsList( * * *
-   * Output only. List of serving configuration ids that that are associated
-   * with this control. Note the association is managed via the ServingConfig,
-   * this is an output only denormalizeed  view. Assumed to be in the same
-   * catalog.
+   * Output only. List of [serving
+   * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+   * associated with this control in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog].
+   * Note the association is managed via the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+   * output only denormalized view.
    * 
* * @@ -504,10 +557,13 @@ public int getAssociatedServingConfigIdsCount() { * * *
-   * Output only. List of serving configuration ids that that are associated
-   * with this control. Note the association is managed via the ServingConfig,
-   * this is an output only denormalizeed  view. Assumed to be in the same
-   * catalog.
+   * Output only. List of [serving
+   * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+   * associated with this control in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog].
+   * Note the association is managed via the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+   * output only denormalized view.
    * 
* * @@ -524,10 +580,13 @@ public java.lang.String getAssociatedServingConfigIds(int index) { * * *
-   * Output only. List of serving configuration ids that that are associated
-   * with this control. Note the association is managed via the ServingConfig,
-   * this is an output only denormalizeed  view. Assumed to be in the same
-   * catalog.
+   * Output only. List of [serving
+   * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+   * associated with this control in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog].
+   * Note the association is managed via the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+   * output only denormalized view.
    * 
* * @@ -561,12 +620,11 @@ public com.google.cloud.retail.v2beta.SolutionType convert(java.lang.Integer fro * * *
-   * Required. Immutable. The solution types that the serving config is used
-   * for. Currently we support setting only one type of solution at creation
-   * time.
+   * Required. Immutable. The solution types that the control is used for.
+   * Currently we support setting only one type of solution at creation time.
    * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
    * If no solution type is provided at creation time, will default to
-   * SOLUTION_TYPE_SEARCH.
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
    * 
* * @@ -585,12 +643,11 @@ public java.util.List getSolutionTy * * *
-   * Required. Immutable. The solution types that the serving config is used
-   * for. Currently we support setting only one type of solution at creation
-   * time.
+   * Required. Immutable. The solution types that the control is used for.
+   * Currently we support setting only one type of solution at creation time.
    * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
    * If no solution type is provided at creation time, will default to
-   * SOLUTION_TYPE_SEARCH.
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
    * 
* * @@ -607,12 +664,11 @@ public int getSolutionTypesCount() { * * *
-   * Required. Immutable. The solution types that the serving config is used
-   * for. Currently we support setting only one type of solution at creation
-   * time.
+   * Required. Immutable. The solution types that the control is used for.
+   * Currently we support setting only one type of solution at creation time.
    * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
    * If no solution type is provided at creation time, will default to
-   * SOLUTION_TYPE_SEARCH.
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
    * 
* * @@ -630,12 +686,11 @@ public com.google.cloud.retail.v2beta.SolutionType getSolutionTypes(int index) { * * *
-   * Required. Immutable. The solution types that the serving config is used
-   * for. Currently we support setting only one type of solution at creation
-   * time.
+   * Required. Immutable. The solution types that the control is used for.
+   * Currently we support setting only one type of solution at creation time.
    * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
    * If no solution type is provided at creation time, will default to
-   * SOLUTION_TYPE_SEARCH.
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
    * 
* * @@ -652,12 +707,11 @@ public java.util.List getSolutionTypesValueList() { * * *
-   * Required. Immutable. The solution types that the serving config is used
-   * for. Currently we support setting only one type of solution at creation
-   * time.
+   * Required. Immutable. The solution types that the control is used for.
+   * Currently we support setting only one type of solution at creation time.
    * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
    * If no solution type is provided at creation time, will default to
-   * SOLUTION_TYPE_SEARCH.
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
    * 
* * @@ -674,6 +728,141 @@ public int getSolutionTypesValue(int index) { private int solutionTypesMemoizedSerializedSize; + public static final int SEARCH_SOLUTION_USE_CASE_FIELD_NUMBER = 7; + private java.util.List searchSolutionUseCase_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.retail.v2beta.SearchSolutionUseCase> + searchSolutionUseCase_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.retail.v2beta.SearchSolutionUseCase>() { + public com.google.cloud.retail.v2beta.SearchSolutionUseCase convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.SearchSolutionUseCase result = + com.google.cloud.retail.v2beta.SearchSolutionUseCase.valueOf(from); + return result == null + ? com.google.cloud.retail.v2beta.SearchSolutionUseCase.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Specifies the use case for the control.
+   * Affects what condition fields can be set.
+   * Only settable by search controls.
+   * Will default to
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+   * if not specified. Currently only allow one search_solution_use_case per
+   * control.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @return A list containing the searchSolutionUseCase. + */ + @java.lang.Override + public java.util.List + getSearchSolutionUseCaseList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.retail.v2beta.SearchSolutionUseCase>( + searchSolutionUseCase_, searchSolutionUseCase_converter_); + } + /** + * + * + *
+   * Specifies the use case for the control.
+   * Affects what condition fields can be set.
+   * Only settable by search controls.
+   * Will default to
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+   * if not specified. Currently only allow one search_solution_use_case per
+   * control.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @return The count of searchSolutionUseCase. + */ + @java.lang.Override + public int getSearchSolutionUseCaseCount() { + return searchSolutionUseCase_.size(); + } + /** + * + * + *
+   * Specifies the use case for the control.
+   * Affects what condition fields can be set.
+   * Only settable by search controls.
+   * Will default to
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+   * if not specified. Currently only allow one search_solution_use_case per
+   * control.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param index The index of the element to return. + * @return The searchSolutionUseCase at the given index. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchSolutionUseCase getSearchSolutionUseCase(int index) { + return searchSolutionUseCase_converter_.convert(searchSolutionUseCase_.get(index)); + } + /** + * + * + *
+   * Specifies the use case for the control.
+   * Affects what condition fields can be set.
+   * Only settable by search controls.
+   * Will default to
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+   * if not specified. Currently only allow one search_solution_use_case per
+   * control.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @return A list containing the enum numeric values on the wire for searchSolutionUseCase. + */ + @java.lang.Override + public java.util.List getSearchSolutionUseCaseValueList() { + return searchSolutionUseCase_; + } + /** + * + * + *
+   * Specifies the use case for the control.
+   * Affects what condition fields can be set.
+   * Only settable by search controls.
+   * Will default to
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+   * if not specified. Currently only allow one search_solution_use_case per
+   * control.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of searchSolutionUseCase at the given index. + */ + @java.lang.Override + public int getSearchSolutionUseCaseValue(int index) { + return searchSolutionUseCase_.get(index); + } + + private int searchSolutionUseCaseMemoizedSerializedSize; + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -712,6 +901,13 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < solutionTypes_.size(); i++) { output.writeEnumNoTag(solutionTypes_.get(i)); } + if (getSearchSolutionUseCaseList().size() > 0) { + output.writeUInt32NoTag(58); + output.writeUInt32NoTag(searchSolutionUseCaseMemoizedSerializedSize); + } + for (int i = 0; i < searchSolutionUseCase_.size(); i++) { + output.writeEnumNoTag(searchSolutionUseCase_.get(i)); + } unknownFields.writeTo(output); } @@ -758,6 +954,20 @@ public int getSerializedSize() { } solutionTypesMemoizedSerializedSize = dataSize; } + { + int dataSize = 0; + for (int i = 0; i < searchSolutionUseCase_.size(); i++) { + dataSize += + com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag( + searchSolutionUseCase_.get(i)); + } + size += dataSize; + if (!getSearchSolutionUseCaseList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + searchSolutionUseCaseMemoizedSerializedSize = dataSize; + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -778,6 +988,7 @@ public boolean equals(final java.lang.Object obj) { if (!getAssociatedServingConfigIdsList().equals(other.getAssociatedServingConfigIdsList())) return false; if (!solutionTypes_.equals(other.solutionTypes_)) return false; + if (!searchSolutionUseCase_.equals(other.searchSolutionUseCase_)) return false; if (!getControlCase().equals(other.getControlCase())) return false; switch (controlCase_) { case 3: @@ -812,6 +1023,10 @@ public int hashCode() { hash = (37 * hash) + SOLUTION_TYPES_FIELD_NUMBER; hash = (53 * hash) + solutionTypes_.hashCode(); } + if (getSearchSolutionUseCaseCount() > 0) { + hash = (37 * hash) + SEARCH_SOLUTION_USE_CASE_FIELD_NUMBER; + hash = (53 * hash) + searchSolutionUseCase_.hashCode(); + } switch (controlCase_) { case 3: hash = (37 * hash) + FACET_SPEC_FIELD_NUMBER; @@ -928,8 +1143,9 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Configures dynamic serving time metadata that is used to pre and post
-   * process search/recommendation model results.
+   * Configures dynamic metadata that can be linked to a
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] and affect search
+   * or recommendation results at serving time.
    * 
* * Protobuf type {@code google.cloud.retail.v2beta.Control} @@ -978,6 +1194,8 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000001); solutionTypes_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); + searchSolutionUseCase_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); controlCase_ = 0; control_ = null; return this; @@ -1034,6 +1252,11 @@ public com.google.cloud.retail.v2beta.Control buildPartial() { bitField0_ = (bitField0_ & ~0x00000002); } result.solutionTypes_ = solutionTypes_; + if (((bitField0_ & 0x00000004) != 0)) { + searchSolutionUseCase_ = java.util.Collections.unmodifiableList(searchSolutionUseCase_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.searchSolutionUseCase_ = searchSolutionUseCase_; result.controlCase_ = controlCase_; onBuilt(); return result; @@ -1112,6 +1335,16 @@ public Builder mergeFrom(com.google.cloud.retail.v2beta.Control other) { } onChanged(); } + if (!other.searchSolutionUseCase_.isEmpty()) { + if (searchSolutionUseCase_.isEmpty()) { + searchSolutionUseCase_ = other.searchSolutionUseCase_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSearchSolutionUseCaseIsMutable(); + searchSolutionUseCase_.addAll(other.searchSolutionUseCase_); + } + onChanged(); + } switch (other.getControlCase()) { case FACET_SPEC: { @@ -1183,13 +1416,19 @@ public Builder clearControl() { * *
      * A facet specification to perform faceted search.
+     * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+     * used for creating a control.
      * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * * + * @deprecated google.cloud.retail.v2beta.Control.facet_spec is deprecated. See + * google/cloud/retail/v2beta/control.proto;l=51 * @return Whether the facetSpec field is set. */ @java.lang.Override + @java.lang.Deprecated public boolean hasFacetSpec() { return controlCase_ == 3; } @@ -1198,13 +1437,19 @@ public boolean hasFacetSpec() { * *
      * A facet specification to perform faceted search.
+     * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+     * used for creating a control.
      * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * * + * @deprecated google.cloud.retail.v2beta.Control.facet_spec is deprecated. See + * google/cloud/retail/v2beta/control.proto;l=51 * @return The facetSpec. */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getFacetSpec() { if (facetSpecBuilder_ == null) { if (controlCase_ == 3) { @@ -1223,10 +1468,14 @@ public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getFacetSpec() { * *
      * A facet specification to perform faceted search.
+     * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+     * used for creating a control.
      * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder setFacetSpec(com.google.cloud.retail.v2beta.SearchRequest.FacetSpec value) { if (facetSpecBuilder_ == null) { if (value == null) { @@ -1245,10 +1494,14 @@ public Builder setFacetSpec(com.google.cloud.retail.v2beta.SearchRequest.FacetSp * *
      * A facet specification to perform faceted search.
+     * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+     * used for creating a control.
      * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder setFacetSpec( com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder builderForValue) { if (facetSpecBuilder_ == null) { @@ -1265,10 +1518,14 @@ public Builder setFacetSpec( * *
      * A facet specification to perform faceted search.
+     * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+     * used for creating a control.
      * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder mergeFacetSpec(com.google.cloud.retail.v2beta.SearchRequest.FacetSpec value) { if (facetSpecBuilder_ == null) { if (controlCase_ == 3 @@ -1298,10 +1555,14 @@ public Builder mergeFacetSpec(com.google.cloud.retail.v2beta.SearchRequest.Facet * *
      * A facet specification to perform faceted search.
+     * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+     * used for creating a control.
      * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * */ + @java.lang.Deprecated public Builder clearFacetSpec() { if (facetSpecBuilder_ == null) { if (controlCase_ == 3) { @@ -1323,10 +1584,14 @@ public Builder clearFacetSpec() { * *
      * A facet specification to perform faceted search.
+     * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+     * used for creating a control.
      * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * */ + @java.lang.Deprecated public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder getFacetSpecBuilder() { return getFacetSpecFieldBuilder().getBuilder(); } @@ -1335,11 +1600,15 @@ public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder getFacetSp * *
      * A facet specification to perform faceted search.
+     * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+     * used for creating a control.
      * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * */ @java.lang.Override + @java.lang.Deprecated public com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder getFacetSpecOrBuilder() { if ((controlCase_ == 3) && (facetSpecBuilder_ != null)) { return facetSpecBuilder_.getMessageOrBuilder(); @@ -1355,9 +1624,12 @@ public com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder getFacetS * *
      * A facet specification to perform faceted search.
+     * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+     * used for creating a control.
      * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.retail.v2beta.SearchRequest.FacetSpec, @@ -1850,10 +2122,13 @@ private void ensureAssociatedServingConfigIdsIsMutable() { * * *
-     * Output only. List of serving configuration ids that that are associated
-     * with this control. Note the association is managed via the ServingConfig,
-     * this is an output only denormalizeed  view. Assumed to be in the same
-     * catalog.
+     * Output only. List of [serving
+     * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+     * associated with this control in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
+     * Note the association is managed via the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+     * output only denormalized view.
      * 
* * @@ -1869,10 +2144,13 @@ public com.google.protobuf.ProtocolStringList getAssociatedServingConfigIdsList( * * *
-     * Output only. List of serving configuration ids that that are associated
-     * with this control. Note the association is managed via the ServingConfig,
-     * this is an output only denormalizeed  view. Assumed to be in the same
-     * catalog.
+     * Output only. List of [serving
+     * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+     * associated with this control in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
+     * Note the association is managed via the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+     * output only denormalized view.
      * 
* * @@ -1888,10 +2166,13 @@ public int getAssociatedServingConfigIdsCount() { * * *
-     * Output only. List of serving configuration ids that that are associated
-     * with this control. Note the association is managed via the ServingConfig,
-     * this is an output only denormalizeed  view. Assumed to be in the same
-     * catalog.
+     * Output only. List of [serving
+     * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+     * associated with this control in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
+     * Note the association is managed via the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+     * output only denormalized view.
      * 
* * @@ -1908,10 +2189,13 @@ public java.lang.String getAssociatedServingConfigIds(int index) { * * *
-     * Output only. List of serving configuration ids that that are associated
-     * with this control. Note the association is managed via the ServingConfig,
-     * this is an output only denormalizeed  view. Assumed to be in the same
-     * catalog.
+     * Output only. List of [serving
+     * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+     * associated with this control in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
+     * Note the association is managed via the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+     * output only denormalized view.
      * 
* * @@ -1928,10 +2212,13 @@ public com.google.protobuf.ByteString getAssociatedServingConfigIdsBytes(int ind * * *
-     * Output only. List of serving configuration ids that that are associated
-     * with this control. Note the association is managed via the ServingConfig,
-     * this is an output only denormalizeed  view. Assumed to be in the same
-     * catalog.
+     * Output only. List of [serving
+     * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+     * associated with this control in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
+     * Note the association is managed via the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+     * output only denormalized view.
      * 
* * @@ -1955,10 +2242,13 @@ public Builder setAssociatedServingConfigIds(int index, java.lang.String value) * * *
-     * Output only. List of serving configuration ids that that are associated
-     * with this control. Note the association is managed via the ServingConfig,
-     * this is an output only denormalizeed  view. Assumed to be in the same
-     * catalog.
+     * Output only. List of [serving
+     * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+     * associated with this control in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
+     * Note the association is managed via the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+     * output only denormalized view.
      * 
* * @@ -1981,10 +2271,13 @@ public Builder addAssociatedServingConfigIds(java.lang.String value) { * * *
-     * Output only. List of serving configuration ids that that are associated
-     * with this control. Note the association is managed via the ServingConfig,
-     * this is an output only denormalizeed  view. Assumed to be in the same
-     * catalog.
+     * Output only. List of [serving
+     * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+     * associated with this control in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
+     * Note the association is managed via the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+     * output only denormalized view.
      * 
* * @@ -2004,10 +2297,13 @@ public Builder addAllAssociatedServingConfigIds(java.lang.Iterable - * Output only. List of serving configuration ids that that are associated - * with this control. Note the association is managed via the ServingConfig, - * this is an output only denormalizeed view. Assumed to be in the same - * catalog. + * Output only. List of [serving + * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are + * associated with this control in the same + * [Catalog][google.cloud.retail.v2beta.Catalog]. + * Note the association is managed via the + * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an + * output only denormalized view. * * * @@ -2026,10 +2322,13 @@ public Builder clearAssociatedServingConfigIds() { * * *
-     * Output only. List of serving configuration ids that that are associated
-     * with this control. Note the association is managed via the ServingConfig,
-     * this is an output only denormalizeed  view. Assumed to be in the same
-     * catalog.
+     * Output only. List of [serving
+     * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+     * associated with this control in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog].
+     * Note the association is managed via the
+     * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+     * output only denormalized view.
      * 
* * @@ -2062,12 +2361,11 @@ private void ensureSolutionTypesIsMutable() { * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2085,12 +2383,11 @@ public java.util.List getSolutionTy * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2106,12 +2403,11 @@ public int getSolutionTypesCount() { * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2128,12 +2424,11 @@ public com.google.cloud.retail.v2beta.SolutionType getSolutionTypes(int index) { * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2157,12 +2452,11 @@ public Builder setSolutionTypes(int index, com.google.cloud.retail.v2beta.Soluti * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2185,12 +2479,11 @@ public Builder addSolutionTypes(com.google.cloud.retail.v2beta.SolutionType valu * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2213,12 +2506,11 @@ public Builder addAllSolutionTypes( * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2237,12 +2529,11 @@ public Builder clearSolutionTypes() { * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2258,12 +2549,11 @@ public java.util.List getSolutionTypesValueList() { * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2280,12 +2570,11 @@ public int getSolutionTypesValue(int index) { * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2306,12 +2595,11 @@ public Builder setSolutionTypesValue(int index, int value) { * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2331,12 +2619,11 @@ public Builder addSolutionTypesValue(int value) { * * *
-     * Required. Immutable. The solution types that the serving config is used
-     * for. Currently we support setting only one type of solution at creation
-     * time.
+     * Required. Immutable. The solution types that the control is used for.
+     * Currently we support setting only one type of solution at creation time.
      * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
      * If no solution type is provided at creation time, will default to
-     * SOLUTION_TYPE_SEARCH.
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
      * 
* * @@ -2355,6 +2642,328 @@ public Builder addAllSolutionTypesValue(java.lang.Iterable va return this; } + private java.util.List searchSolutionUseCase_ = + java.util.Collections.emptyList(); + + private void ensureSearchSolutionUseCaseIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + searchSolutionUseCase_ = new java.util.ArrayList(searchSolutionUseCase_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @return A list containing the searchSolutionUseCase. + */ + public java.util.List + getSearchSolutionUseCaseList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.retail.v2beta.SearchSolutionUseCase>( + searchSolutionUseCase_, searchSolutionUseCase_converter_); + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @return The count of searchSolutionUseCase. + */ + public int getSearchSolutionUseCaseCount() { + return searchSolutionUseCase_.size(); + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param index The index of the element to return. + * @return The searchSolutionUseCase at the given index. + */ + public com.google.cloud.retail.v2beta.SearchSolutionUseCase getSearchSolutionUseCase( + int index) { + return searchSolutionUseCase_converter_.convert(searchSolutionUseCase_.get(index)); + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param index The index to set the value at. + * @param value The searchSolutionUseCase to set. + * @return This builder for chaining. + */ + public Builder setSearchSolutionUseCase( + int index, com.google.cloud.retail.v2beta.SearchSolutionUseCase value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchSolutionUseCaseIsMutable(); + searchSolutionUseCase_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param value The searchSolutionUseCase to add. + * @return This builder for chaining. + */ + public Builder addSearchSolutionUseCase( + com.google.cloud.retail.v2beta.SearchSolutionUseCase value) { + if (value == null) { + throw new NullPointerException(); + } + ensureSearchSolutionUseCaseIsMutable(); + searchSolutionUseCase_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param values The searchSolutionUseCase to add. + * @return This builder for chaining. + */ + public Builder addAllSearchSolutionUseCase( + java.lang.Iterable values) { + ensureSearchSolutionUseCaseIsMutable(); + for (com.google.cloud.retail.v2beta.SearchSolutionUseCase value : values) { + searchSolutionUseCase_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @return This builder for chaining. + */ + public Builder clearSearchSolutionUseCase() { + searchSolutionUseCase_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @return A list containing the enum numeric values on the wire for searchSolutionUseCase. + */ + public java.util.List getSearchSolutionUseCaseValueList() { + return java.util.Collections.unmodifiableList(searchSolutionUseCase_); + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of searchSolutionUseCase at the given index. + */ + public int getSearchSolutionUseCaseValue(int index) { + return searchSolutionUseCase_.get(index); + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for searchSolutionUseCase to set. + * @return This builder for chaining. + */ + public Builder setSearchSolutionUseCaseValue(int index, int value) { + ensureSearchSolutionUseCaseIsMutable(); + searchSolutionUseCase_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param value The enum numeric value on the wire for searchSolutionUseCase to add. + * @return This builder for chaining. + */ + public Builder addSearchSolutionUseCaseValue(int value) { + ensureSearchSolutionUseCaseIsMutable(); + searchSolutionUseCase_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Specifies the use case for the control.
+     * Affects what condition fields can be set.
+     * Only settable by search controls.
+     * Will default to
+     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+     * if not specified. Currently only allow one search_solution_use_case per
+     * control.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param values The enum numeric values on the wire for searchSolutionUseCase to add. + * @return This builder for chaining. + */ + public Builder addAllSearchSolutionUseCaseValue(java.lang.Iterable values) { + ensureSearchSolutionUseCaseIsMutable(); + for (int value : values) { + searchSolutionUseCase_.add(value); + } + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlOrBuilder.java index 981622f23f20..c31de227a140 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlOrBuilder.java @@ -28,34 +28,50 @@ public interface ControlOrBuilder * *
    * A facet specification to perform faceted search.
+   * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+   * used for creating a control.
    * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * * + * @deprecated google.cloud.retail.v2beta.Control.facet_spec is deprecated. See + * google/cloud/retail/v2beta/control.proto;l=51 * @return Whether the facetSpec field is set. */ + @java.lang.Deprecated boolean hasFacetSpec(); /** * * *
    * A facet specification to perform faceted search.
+   * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+   * used for creating a control.
    * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * * + * @deprecated google.cloud.retail.v2beta.Control.facet_spec is deprecated. See + * google/cloud/retail/v2beta/control.proto;l=51 * @return The facetSpec. */ + @java.lang.Deprecated com.google.cloud.retail.v2beta.SearchRequest.FacetSpec getFacetSpec(); /** * * *
    * A facet specification to perform faceted search.
+   * Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+   * used for creating a control.
    * 
* - * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3; + * .google.cloud.retail.v2beta.SearchRequest.FacetSpec facet_spec = 3 [deprecated = true]; + * */ + @java.lang.Deprecated com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder getFacetSpecOrBuilder(); /** @@ -159,10 +175,13 @@ public interface ControlOrBuilder * * *
-   * Output only. List of serving configuration ids that that are associated
-   * with this control. Note the association is managed via the ServingConfig,
-   * this is an output only denormalizeed  view. Assumed to be in the same
-   * catalog.
+   * Output only. List of [serving
+   * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+   * associated with this control in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog].
+   * Note the association is managed via the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+   * output only denormalized view.
    * 
* * @@ -176,10 +195,13 @@ public interface ControlOrBuilder * * *
-   * Output only. List of serving configuration ids that that are associated
-   * with this control. Note the association is managed via the ServingConfig,
-   * this is an output only denormalizeed  view. Assumed to be in the same
-   * catalog.
+   * Output only. List of [serving
+   * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+   * associated with this control in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog].
+   * Note the association is managed via the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+   * output only denormalized view.
    * 
* * @@ -193,10 +215,13 @@ public interface ControlOrBuilder * * *
-   * Output only. List of serving configuration ids that that are associated
-   * with this control. Note the association is managed via the ServingConfig,
-   * this is an output only denormalizeed  view. Assumed to be in the same
-   * catalog.
+   * Output only. List of [serving
+   * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+   * associated with this control in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog].
+   * Note the association is managed via the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+   * output only denormalized view.
    * 
* * @@ -211,10 +236,13 @@ public interface ControlOrBuilder * * *
-   * Output only. List of serving configuration ids that that are associated
-   * with this control. Note the association is managed via the ServingConfig,
-   * this is an output only denormalizeed  view. Assumed to be in the same
-   * catalog.
+   * Output only. List of [serving
+   * configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+   * associated with this control in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog].
+   * Note the association is managed via the
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+   * output only denormalized view.
    * 
* * @@ -230,12 +258,11 @@ public interface ControlOrBuilder * * *
-   * Required. Immutable. The solution types that the serving config is used
-   * for. Currently we support setting only one type of solution at creation
-   * time.
+   * Required. Immutable. The solution types that the control is used for.
+   * Currently we support setting only one type of solution at creation time.
    * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
    * If no solution type is provided at creation time, will default to
-   * SOLUTION_TYPE_SEARCH.
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
    * 
* * @@ -249,12 +276,11 @@ public interface ControlOrBuilder * * *
-   * Required. Immutable. The solution types that the serving config is used
-   * for. Currently we support setting only one type of solution at creation
-   * time.
+   * Required. Immutable. The solution types that the control is used for.
+   * Currently we support setting only one type of solution at creation time.
    * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
    * If no solution type is provided at creation time, will default to
-   * SOLUTION_TYPE_SEARCH.
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
    * 
* * @@ -268,12 +294,11 @@ public interface ControlOrBuilder * * *
-   * Required. Immutable. The solution types that the serving config is used
-   * for. Currently we support setting only one type of solution at creation
-   * time.
+   * Required. Immutable. The solution types that the control is used for.
+   * Currently we support setting only one type of solution at creation time.
    * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
    * If no solution type is provided at creation time, will default to
-   * SOLUTION_TYPE_SEARCH.
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
    * 
* * @@ -288,12 +313,11 @@ public interface ControlOrBuilder * * *
-   * Required. Immutable. The solution types that the serving config is used
-   * for. Currently we support setting only one type of solution at creation
-   * time.
+   * Required. Immutable. The solution types that the control is used for.
+   * Currently we support setting only one type of solution at creation time.
    * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
    * If no solution type is provided at creation time, will default to
-   * SOLUTION_TYPE_SEARCH.
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
    * 
* * @@ -307,12 +331,11 @@ public interface ControlOrBuilder * * *
-   * Required. Immutable. The solution types that the serving config is used
-   * for. Currently we support setting only one type of solution at creation
-   * time.
+   * Required. Immutable. The solution types that the control is used for.
+   * Currently we support setting only one type of solution at creation time.
    * Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
    * If no solution type is provided at creation time, will default to
-   * SOLUTION_TYPE_SEARCH.
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
    * 
* * @@ -324,5 +347,104 @@ public interface ControlOrBuilder */ int getSolutionTypesValue(int index); + /** + * + * + *
+   * Specifies the use case for the control.
+   * Affects what condition fields can be set.
+   * Only settable by search controls.
+   * Will default to
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+   * if not specified. Currently only allow one search_solution_use_case per
+   * control.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @return A list containing the searchSolutionUseCase. + */ + java.util.List + getSearchSolutionUseCaseList(); + /** + * + * + *
+   * Specifies the use case for the control.
+   * Affects what condition fields can be set.
+   * Only settable by search controls.
+   * Will default to
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+   * if not specified. Currently only allow one search_solution_use_case per
+   * control.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @return The count of searchSolutionUseCase. + */ + int getSearchSolutionUseCaseCount(); + /** + * + * + *
+   * Specifies the use case for the control.
+   * Affects what condition fields can be set.
+   * Only settable by search controls.
+   * Will default to
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+   * if not specified. Currently only allow one search_solution_use_case per
+   * control.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param index The index of the element to return. + * @return The searchSolutionUseCase at the given index. + */ + com.google.cloud.retail.v2beta.SearchSolutionUseCase getSearchSolutionUseCase(int index); + /** + * + * + *
+   * Specifies the use case for the control.
+   * Affects what condition fields can be set.
+   * Only settable by search controls.
+   * Will default to
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+   * if not specified. Currently only allow one search_solution_use_case per
+   * control.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @return A list containing the enum numeric values on the wire for searchSolutionUseCase. + */ + java.util.List getSearchSolutionUseCaseValueList(); + /** + * + * + *
+   * Specifies the use case for the control.
+   * Affects what condition fields can be set.
+   * Only settable by search controls.
+   * Will default to
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+   * if not specified. Currently only allow one search_solution_use_case per
+   * control.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.SearchSolutionUseCase search_solution_use_case = 7; + * + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of searchSolutionUseCase at the given index. + */ + int getSearchSolutionUseCaseValue(int index); + public com.google.cloud.retail.v2beta.Control.ControlCase getControlCase(); } diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlProto.java index 7c290506b482..3e1a2093a6d0 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlProto.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ControlProto.java @@ -45,23 +45,25 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "pi/field_behavior.proto\032\031google/api/reso" + "urce.proto\032\'google/cloud/retail/v2beta/c" + "ommon.proto\032/google/cloud/retail/v2beta/" - + "search_service.proto\"\250\003\n\007Control\022I\n\nface" + + "search_service.proto\"\201\004\n\007Control\022M\n\nface" + "t_spec\030\003 \001(\01323.google.cloud.retail.v2bet" - + "a.SearchRequest.FacetSpecH\000\0220\n\004rule\030\004 \001(" - + "\0132 .google.cloud.retail.v2beta.RuleH\000\022\021\n" - + "\004name\030\001 \001(\tB\003\340A\005\022\031\n\014display_name\030\002 \001(\tB\003" - + "\340A\002\022*\n\035associated_serving_config_ids\030\005 \003" - + "(\tB\003\340A\003\022H\n\016solution_types\030\006 \003(\0162(.google" - + ".cloud.retail.v2beta.SolutionTypeB\006\340A\002\340A" - + "\005:q\352An\n\035retail.googleapis.com/Control\022Mp" - + "rojects/{project}/locations/{location}/c" - + "atalogs/{catalog}/controls/{control}B\t\n\007" - + "controlB\325\001\n\036com.google.cloud.retail.v2be" - + "taB\014ControlProtoP\001Z@google.golang.org/ge" - + "nproto/googleapis/cloud/retail/v2beta;re" - + "tail\242\002\006RETAIL\252\002\032Google.Cloud.Retail.V2Be" - + "ta\312\002\032Google\\Cloud\\Retail\\V2beta\352\002\035Google" - + "::Cloud::Retail::V2betab\006proto3" + + "a.SearchRequest.FacetSpecB\002\030\001H\000\0220\n\004rule\030" + + "\004 \001(\0132 .google.cloud.retail.v2beta.RuleH" + + "\000\022\021\n\004name\030\001 \001(\tB\003\340A\005\022\031\n\014display_name\030\002 \001" + + "(\tB\003\340A\002\022*\n\035associated_serving_config_ids" + + "\030\005 \003(\tB\003\340A\003\022H\n\016solution_types\030\006 \003(\0162(.go" + + "ogle.cloud.retail.v2beta.SolutionTypeB\006\340" + + "A\002\340A\005\022S\n\030search_solution_use_case\030\007 \003(\0162" + + "1.google.cloud.retail.v2beta.SearchSolut" + + "ionUseCase:q\352An\n\035retail.googleapis.com/C" + + "ontrol\022Mprojects/{project}/locations/{lo" + + "cation}/catalogs/{catalog}/controls/{con" + + "trol}B\t\n\007controlB\325\001\n\036com.google.cloud.re" + + "tail.v2betaB\014ControlProtoP\001Z@google.gola" + + "ng.org/genproto/googleapis/cloud/retail/" + + "v2beta;retail\242\002\006RETAIL\252\002\032Google.Cloud.Re" + + "tail.V2Beta\312\002\032Google\\Cloud\\Retail\\V2beta" + + "\352\002\035Google::Cloud::Retail::V2betab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -84,6 +86,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DisplayName", "AssociatedServingConfigIds", "SolutionTypes", + "SearchSolutionUseCase", "Control", }); com.google.protobuf.ExtensionRegistry registry = diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelMetadata.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelMetadata.java new file mode 100644 index 000000000000..307945f303d8 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelMetadata.java @@ -0,0 +1,652 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata associated with a create operation.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CreateModelMetadata} + */ +public final class CreateModelMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CreateModelMetadata) + CreateModelMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateModelMetadata.newBuilder() to construct. + private CreateModelMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateModelMetadata() { + model_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateModelMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateModelMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + model_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_CreateModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_CreateModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CreateModelMetadata.class, + com.google.cloud.retail.v2beta.CreateModelMetadata.Builder.class); + } + + public static final int MODEL_FIELD_NUMBER = 1; + private volatile java.lang.Object model_; + /** + * + * + *
+   * The resource name of the model that this create applies to.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string model = 1; + * + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + 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(); + model_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the model that this create applies to.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string model = 1; + * + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = 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(model_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, model_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, model_); + } + size += unknownFields.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.CreateModelMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CreateModelMetadata other = + (com.google.cloud.retail.v2beta.CreateModelMetadata) obj; + + if (!getModel().equals(other.getModel())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CreateModelMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateModelMetadata 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.CreateModelMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateModelMetadata 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.CreateModelMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateModelMetadata 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.CreateModelMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CreateModelMetadata 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.CreateModelMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CreateModelMetadata 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.CreateModelMetadata 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.CreateModelMetadata 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.CreateModelMetadata 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; + } + /** + * + * + *
+   * Metadata associated with a create operation.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CreateModelMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CreateModelMetadata) + com.google.cloud.retail.v2beta.CreateModelMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_CreateModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_CreateModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CreateModelMetadata.class, + com.google.cloud.retail.v2beta.CreateModelMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CreateModelMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + model_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_CreateModelMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateModelMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CreateModelMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateModelMetadata build() { + com.google.cloud.retail.v2beta.CreateModelMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateModelMetadata buildPartial() { + com.google.cloud.retail.v2beta.CreateModelMetadata result = + new com.google.cloud.retail.v2beta.CreateModelMetadata(this); + result.model_ = model_; + onBuilt(); + return result; + } + + @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.CreateModelMetadata) { + return mergeFrom((com.google.cloud.retail.v2beta.CreateModelMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CreateModelMetadata other) { + if (other == com.google.cloud.retail.v2beta.CreateModelMetadata.getDefaultInstance()) + return this; + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.CreateModelMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.CreateModelMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object model_ = ""; + /** + * + * + *
+     * The resource name of the model that this create applies to.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string model = 1; + * + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the model that this create applies to.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string model = 1; + * + * @return The bytes for model. + */ + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the model that this create applies to.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string model = 1; + * + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + model_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the model that this create applies to.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string model = 1; + * + * @return This builder for chaining. + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the model that this create applies to.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string model = 1; + * + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + model_ = value; + 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.CreateModelMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CreateModelMetadata) + private static final com.google.cloud.retail.v2beta.CreateModelMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CreateModelMetadata(); + } + + public static com.google.cloud.retail.v2beta.CreateModelMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateModelMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateModelMetadata(input, extensionRegistry); + } + }; + + 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.CreateModelMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelMetadataOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelMetadataOrBuilder.java new file mode 100644 index 000000000000..91701b6d7cc8 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelMetadataOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public interface CreateModelMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CreateModelMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the model that this create applies to.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string model = 1; + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * The resource name of the model that this create applies to.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string model = 1; + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelRequest.java new file mode 100644 index 000000000000..b61063ca2156 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelRequest.java @@ -0,0 +1,1048 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for creating a model.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CreateModelRequest} + */ +public final class CreateModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.CreateModelRequest) + CreateModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateModelRequest.newBuilder() to construct. + private CreateModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateModelRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateModelRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateModelRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.retail.v2beta.Model.Builder subBuilder = null; + if (model_ != null) { + subBuilder = model_.toBuilder(); + } + model_ = + input.readMessage( + com.google.cloud.retail.v2beta.Model.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(model_); + model_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + dryRun_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_CreateModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_CreateModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CreateModelRequest.class, + com.google.cloud.retail.v2beta.CreateModelRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource under which to create the model. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource under which to create the model. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODEL_FIELD_NUMBER = 2; + private com.google.cloud.retail.v2beta.Model model_; + /** + * + * + *
+   * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+   * create.
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the model field is set. + */ + @java.lang.Override + public boolean hasModel() { + return model_ != null; + } + /** + * + * + *
+   * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+   * create.
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The model. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model getModel() { + return model_ == null ? com.google.cloud.retail.v2beta.Model.getDefaultInstance() : model_; + } + /** + * + * + *
+   * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+   * create.
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ModelOrBuilder getModelOrBuilder() { + return getModel(); + } + + public static final int DRY_RUN_FIELD_NUMBER = 3; + private boolean dryRun_; + /** + * + * + *
+   * Optional. Whether to run a dry run to validate the request (without
+   * actually creating the model).
+   * 
+ * + * bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dryRun. + */ + @java.lang.Override + public boolean getDryRun() { + return dryRun_; + } + + 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(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (model_ != null) { + output.writeMessage(2, getModel()); + } + if (dryRun_ != false) { + output.writeBool(3, dryRun_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (model_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getModel()); + } + if (dryRun_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, dryRun_); + } + size += unknownFields.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.CreateModelRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.CreateModelRequest other = + (com.google.cloud.retail.v2beta.CreateModelRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasModel() != other.hasModel()) return false; + if (hasModel()) { + if (!getModel().equals(other.getModel())) return false; + } + if (getDryRun() != other.getDryRun()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasModel()) { + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + } + hash = (37 * hash) + DRY_RUN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDryRun()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.CreateModelRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateModelRequest 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.CreateModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateModelRequest 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.CreateModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.CreateModelRequest 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.CreateModelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CreateModelRequest 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.CreateModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.CreateModelRequest 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.CreateModelRequest 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.CreateModelRequest 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.CreateModelRequest 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 for creating a model.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.CreateModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.CreateModelRequest) + com.google.cloud.retail.v2beta.CreateModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_CreateModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_CreateModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.CreateModelRequest.class, + com.google.cloud.retail.v2beta.CreateModelRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.CreateModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (modelBuilder_ == null) { + model_ = null; + } else { + model_ = null; + modelBuilder_ = null; + } + dryRun_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_CreateModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateModelRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.CreateModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateModelRequest build() { + com.google.cloud.retail.v2beta.CreateModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.CreateModelRequest buildPartial() { + com.google.cloud.retail.v2beta.CreateModelRequest result = + new com.google.cloud.retail.v2beta.CreateModelRequest(this); + result.parent_ = parent_; + if (modelBuilder_ == null) { + result.model_ = model_; + } else { + result.model_ = modelBuilder_.build(); + } + result.dryRun_ = dryRun_; + onBuilt(); + return result; + } + + @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.CreateModelRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.CreateModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.CreateModelRequest other) { + if (other == com.google.cloud.retail.v2beta.CreateModelRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasModel()) { + mergeModel(other.getModel()); + } + if (other.getDryRun() != false) { + setDryRun(other.getDryRun()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.CreateModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.CreateModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource under which to create the model. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource under which to create the model. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource under which to create the model. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource under which to create the model. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource under which to create the model. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.retail.v2beta.Model model_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Model, + com.google.cloud.retail.v2beta.Model.Builder, + com.google.cloud.retail.v2beta.ModelOrBuilder> + modelBuilder_; + /** + * + * + *
+     * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+     * create.
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the model field is set. + */ + public boolean hasModel() { + return modelBuilder_ != null || model_ != null; + } + /** + * + * + *
+     * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+     * create.
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The model. + */ + public com.google.cloud.retail.v2beta.Model getModel() { + if (modelBuilder_ == null) { + return model_ == null ? com.google.cloud.retail.v2beta.Model.getDefaultInstance() : model_; + } else { + return modelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+     * create.
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setModel(com.google.cloud.retail.v2beta.Model value) { + if (modelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + model_ = value; + onChanged(); + } else { + modelBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+     * create.
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setModel(com.google.cloud.retail.v2beta.Model.Builder builderForValue) { + if (modelBuilder_ == null) { + model_ = builderForValue.build(); + onChanged(); + } else { + modelBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+     * create.
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeModel(com.google.cloud.retail.v2beta.Model value) { + if (modelBuilder_ == null) { + if (model_ != null) { + model_ = + com.google.cloud.retail.v2beta.Model.newBuilder(model_) + .mergeFrom(value) + .buildPartial(); + } else { + model_ = value; + } + onChanged(); + } else { + modelBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+     * create.
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearModel() { + if (modelBuilder_ == null) { + model_ = null; + onChanged(); + } else { + model_ = null; + modelBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+     * create.
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Model.Builder getModelBuilder() { + + onChanged(); + return getModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+     * create.
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ModelOrBuilder getModelOrBuilder() { + if (modelBuilder_ != null) { + return modelBuilder_.getMessageOrBuilder(); + } else { + return model_ == null ? com.google.cloud.retail.v2beta.Model.getDefaultInstance() : model_; + } + } + /** + * + * + *
+     * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+     * create.
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Model, + com.google.cloud.retail.v2beta.Model.Builder, + com.google.cloud.retail.v2beta.ModelOrBuilder> + getModelFieldBuilder() { + if (modelBuilder_ == null) { + modelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Model, + com.google.cloud.retail.v2beta.Model.Builder, + com.google.cloud.retail.v2beta.ModelOrBuilder>( + getModel(), getParentForChildren(), isClean()); + model_ = null; + } + return modelBuilder_; + } + + private boolean dryRun_; + /** + * + * + *
+     * Optional. Whether to run a dry run to validate the request (without
+     * actually creating the model).
+     * 
+ * + * bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dryRun. + */ + @java.lang.Override + public boolean getDryRun() { + return dryRun_; + } + /** + * + * + *
+     * Optional. Whether to run a dry run to validate the request (without
+     * actually creating the model).
+     * 
+ * + * bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The dryRun to set. + * @return This builder for chaining. + */ + public Builder setDryRun(boolean value) { + + dryRun_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Whether to run a dry run to validate the request (without
+     * actually creating the model).
+     * 
+ * + * bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearDryRun() { + + dryRun_ = false; + 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.CreateModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.CreateModelRequest) + private static final com.google.cloud.retail.v2beta.CreateModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.CreateModelRequest(); + } + + public static com.google.cloud.retail.v2beta.CreateModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateModelRequest(input, extensionRegistry); + } + }; + + 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.CreateModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelRequestOrBuilder.java new file mode 100644 index 000000000000..497858b727df --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CreateModelRequestOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public interface CreateModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.CreateModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource under which to create the model. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource under which to create the model. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+   * create.
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the model field is set. + */ + boolean hasModel(); + /** + * + * + *
+   * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+   * create.
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The model. + */ + com.google.cloud.retail.v2beta.Model getModel(); + /** + * + * + *
+   * Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+   * create.
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ModelOrBuilder getModelOrBuilder(); + + /** + * + * + *
+   * Optional. Whether to run a dry run to validate the request (without
+   * actually creating the model).
+   * 
+ * + * bool dry_run = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The dryRun. + */ + boolean getDryRun(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttribute.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttribute.java index fe2e2c41ee93..e7f983c62e3d 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttribute.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttribute.java @@ -330,7 +330,7 @@ public double getNumbers(int index) { * optional bool searchable = 3 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.searchable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=423 + * google/cloud/retail/v2beta/common.proto;l=425 * @return Whether the searchable field is set. */ @java.lang.Override @@ -359,7 +359,7 @@ public boolean hasSearchable() { * optional bool searchable = 3 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.searchable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=423 + * google/cloud/retail/v2beta/common.proto;l=425 * @return The searchable. */ @java.lang.Override @@ -396,7 +396,7 @@ public boolean getSearchable() { * optional bool indexable = 4 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.indexable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=444 + * google/cloud/retail/v2beta/common.proto;l=446 * @return Whether the indexable field is set. */ @java.lang.Override @@ -430,7 +430,7 @@ public boolean hasIndexable() { * optional bool indexable = 4 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.indexable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=444 + * google/cloud/retail/v2beta/common.proto;l=446 * @return The indexable. */ @java.lang.Override @@ -1262,7 +1262,7 @@ public Builder clearNumbers() { * optional bool searchable = 3 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.searchable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=423 + * google/cloud/retail/v2beta/common.proto;l=425 * @return Whether the searchable field is set. */ @java.lang.Override @@ -1291,7 +1291,7 @@ public boolean hasSearchable() { * optional bool searchable = 3 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.searchable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=423 + * google/cloud/retail/v2beta/common.proto;l=425 * @return The searchable. */ @java.lang.Override @@ -1320,7 +1320,7 @@ public boolean getSearchable() { * optional bool searchable = 3 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.searchable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=423 + * google/cloud/retail/v2beta/common.proto;l=425 * @param value The searchable to set. * @return This builder for chaining. */ @@ -1352,7 +1352,7 @@ public Builder setSearchable(boolean value) { * optional bool searchable = 3 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.searchable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=423 + * google/cloud/retail/v2beta/common.proto;l=425 * @return This builder for chaining. */ @java.lang.Deprecated @@ -1390,7 +1390,7 @@ public Builder clearSearchable() { * optional bool indexable = 4 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.indexable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=444 + * google/cloud/retail/v2beta/common.proto;l=446 * @return Whether the indexable field is set. */ @java.lang.Override @@ -1424,7 +1424,7 @@ public boolean hasIndexable() { * optional bool indexable = 4 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.indexable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=444 + * google/cloud/retail/v2beta/common.proto;l=446 * @return The indexable. */ @java.lang.Override @@ -1458,7 +1458,7 @@ public boolean getIndexable() { * optional bool indexable = 4 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.indexable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=444 + * google/cloud/retail/v2beta/common.proto;l=446 * @param value The indexable to set. * @return This builder for chaining. */ @@ -1495,7 +1495,7 @@ public Builder setIndexable(boolean value) { * optional bool indexable = 4 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.indexable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=444 + * google/cloud/retail/v2beta/common.proto;l=446 * @return This builder for chaining. */ @java.lang.Deprecated diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttributeOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttributeOrBuilder.java index d92b849ffd10..cf0373c9562b 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttributeOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/CustomAttributeOrBuilder.java @@ -169,7 +169,7 @@ public interface CustomAttributeOrBuilder * optional bool searchable = 3 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.searchable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=423 + * google/cloud/retail/v2beta/common.proto;l=425 * @return Whether the searchable field is set. */ @java.lang.Deprecated @@ -195,7 +195,7 @@ public interface CustomAttributeOrBuilder * optional bool searchable = 3 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.searchable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=423 + * google/cloud/retail/v2beta/common.proto;l=425 * @return The searchable. */ @java.lang.Deprecated @@ -227,7 +227,7 @@ public interface CustomAttributeOrBuilder * optional bool indexable = 4 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.indexable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=444 + * google/cloud/retail/v2beta/common.proto;l=446 * @return Whether the indexable field is set. */ @java.lang.Deprecated @@ -258,7 +258,7 @@ public interface CustomAttributeOrBuilder * optional bool indexable = 4 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.CustomAttribute.indexable is deprecated. See - * google/cloud/retail/v2beta/common.proto;l=444 + * google/cloud/retail/v2beta/common.proto;l=446 * @return The indexable. */ @java.lang.Deprecated diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteModelRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteModelRequest.java new file mode 100644 index 000000000000..5113a65827d4 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteModelRequest.java @@ -0,0 +1,666 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for deleting a model.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.DeleteModelRequest} + */ +public final class DeleteModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.DeleteModelRequest) + DeleteModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteModelRequest.newBuilder() to construct. + private DeleteModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteModelRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteModelRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteModelRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.DeleteModelRequest.class, + com.google.cloud.retail.v2beta.DeleteModelRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the
+   * [Model][google.cloud.retail.v2beta.Model] to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the
+   * [Model][google.cloud.retail.v2beta.Model] to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.DeleteModelRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.DeleteModelRequest other = + (com.google.cloud.retail.v2beta.DeleteModelRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.DeleteModelRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteModelRequest 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.DeleteModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteModelRequest 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.DeleteModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.DeleteModelRequest 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.DeleteModelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.DeleteModelRequest 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.DeleteModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.DeleteModelRequest 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.DeleteModelRequest 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.DeleteModelRequest 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.DeleteModelRequest 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 for deleting a model.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.DeleteModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.DeleteModelRequest) + com.google.cloud.retail.v2beta.DeleteModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.DeleteModelRequest.class, + com.google.cloud.retail.v2beta.DeleteModelRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.DeleteModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_DeleteModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteModelRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.DeleteModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteModelRequest build() { + com.google.cloud.retail.v2beta.DeleteModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.DeleteModelRequest buildPartial() { + com.google.cloud.retail.v2beta.DeleteModelRequest result = + new com.google.cloud.retail.v2beta.DeleteModelRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @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.DeleteModelRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.DeleteModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.DeleteModelRequest other) { + if (other == com.google.cloud.retail.v2beta.DeleteModelRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.DeleteModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.DeleteModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the
+     * [Model][google.cloud.retail.v2beta.Model] to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the
+     * [Model][google.cloud.retail.v2beta.Model] to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the
+     * [Model][google.cloud.retail.v2beta.Model] to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the
+     * [Model][google.cloud.retail.v2beta.Model] to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the
+     * [Model][google.cloud.retail.v2beta.Model] to delete. Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + 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.DeleteModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.DeleteModelRequest) + private static final com.google.cloud.retail.v2beta.DeleteModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.DeleteModelRequest(); + } + + public static com.google.cloud.retail.v2beta.DeleteModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteModelRequest(input, extensionRegistry); + } + }; + + 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.DeleteModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteModelRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteModelRequestOrBuilder.java new file mode 100644 index 000000000000..669ae1b8a873 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteModelRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public interface DeleteModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.DeleteModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the
+   * [Model][google.cloud.retail.v2beta.Model] to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the
+   * [Model][google.cloud.retail.v2beta.Model] to delete. Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequest.java index 1f7d041f31d3..ca46b025011c 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequest.java @@ -120,7 +120,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The resource name of the ServingConfig to delete. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -146,7 +146,7 @@ public java.lang.String getName() { * *
    * Required. The resource name of the ServingConfig to delete. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -493,7 +493,7 @@ public Builder mergeFrom( * *
      * Required. The resource name of the ServingConfig to delete. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -518,7 +518,7 @@ public java.lang.String getName() { * *
      * Required. The resource name of the ServingConfig to delete. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -543,7 +543,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
      * Required. The resource name of the ServingConfig to delete. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -567,7 +567,7 @@ public Builder setName(java.lang.String value) { * *
      * Required. The resource name of the ServingConfig to delete. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -587,7 +587,7 @@ public Builder clearName() { * *
      * Required. The resource name of the ServingConfig to delete. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequestOrBuilder.java index 6b9c0d615afd..8539c963be16 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/DeleteServingConfigRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface DeleteServingConfigRequestOrBuilder * *
    * Required. The resource name of the ServingConfig to delete. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -43,7 +43,7 @@ public interface DeleteServingConfigRequestOrBuilder * *
    * Required. The resource name of the ServingConfig to delete. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * 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 1e8def07b747..e83032696c13 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 @@ -62,37 +62,41 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { java.lang.String[] descriptorData = { "\n.google/cloud/retail/v2beta/export_conf" + "ig.proto\022\032google.cloud.retail.v2beta\032\037go" - + "ogle/protobuf/timestamp.proto\032\027google/rp" - + "c/status.proto\"9\n\022ExportErrorsConfig\022\024\n\n" - + "gcs_prefix\030\001 \001(\tH\000B\r\n\013destination\"r\n\016Exp" - + "ortMetadata\022/\n\013create_time\030\001 \001(\0132\032.googl" - + "e.protobuf.Timestamp\022/\n\013update_time\030\002 \001(" - + "\0132\032.google.protobuf.Timestamp\"\313\001\n\026Export" - + "ProductsResponse\022)\n\rerror_samples\030\001 \003(\0132" - + "\022.google.rpc.Status\022E\n\rerrors_config\030\002 \001" - + "(\0132..google.cloud.retail.v2beta.ExportEr" - + "rorsConfig\022?\n\routput_result\030\003 \001(\0132(.goog" - + "le.cloud.retail.v2beta.OutputResult\"\315\001\n\030" - + "ExportUserEventsResponse\022)\n\rerror_sample" - + "s\030\001 \003(\0132\022.google.rpc.Status\022E\n\rerrors_co" - + "nfig\030\002 \001(\0132..google.cloud.retail.v2beta." - + "ExportErrorsConfig\022?\n\routput_result\030\003 \001(" - + "\0132(.google.cloud.retail.v2beta.OutputRes" - + "ult\"Y\n\014OutputResult\022I\n\017bigquery_result\030\001" - + " \003(\01320.google.cloud.retail.v2beta.BigQue" - + "ryOutputResult\"<\n\024BigQueryOutputResult\022\022" - + "\n\ndataset_id\030\001 \001(\t\022\020\n\010table_id\030\002 \001(\tB\332\001\n" - + "\036com.google.cloud.retail.v2betaB\021ExportC" - + "onfigProtoP\001Z@google.golang.org/genproto" - + "/googleapis/cloud/retail/v2beta;retail\242\002" - + "\006RETAIL\252\002\032Google.Cloud.Retail.V2Beta\312\002\032G" - + "oogle\\Cloud\\Retail\\V2beta\352\002\035Google::Clou" - + "d::Retail::V2betab\006proto3" + + "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\"Y\n\014OutputResult\022" + + "I\n\017bigquery_result\030\001 \003(\01320.google.cloud." + + "retail.v2beta.BigQueryOutputResult\"<\n\024Bi" + + "gQueryOutputResult\022\022\n\ndataset_id\030\001 \001(\t\022\020" + + "\n\010table_id\030\002 \001(\tB\332\001\n\036com.google.cloud.re" + + "tail.v2betaB\021ExportConfigProtoP\001Z@google" + + ".golang.org/genproto/googleapis/cloud/re" + + "tail/v2beta;retail\242\002\006RETAIL\252\002\032Google.Clo" + + "ud.Retail.V2Beta\312\002\032Google\\Cloud\\Retail\\V" + + "2beta\352\002\035Google::Cloud::Retail::V2betab\006p" + + "roto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), com.google.rpc.StatusProto.getDescriptor(), }); @@ -144,6 +148,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "DatasetId", "TableId", }); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); com.google.rpc.StatusProto.getDescriptor(); } diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadata.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadata.java index 16939f5d79b4..c1a792e49a03 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadata.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ExportMetadata.java @@ -22,7 +22,7 @@ * * *
- * Metadata related to the progress of the Export operation. This will be
+ * Metadata related to the progress of the Export operation. This is
  * returned by the google.longrunning.Operation.metadata field.
  * 
* @@ -412,7 +412,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Metadata related to the progress of the Export operation. This will be
+   * Metadata related to the progress of the Export operation. This is
    * returned by the google.longrunning.Operation.metadata field.
    * 
* diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSource.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSource.java index a4941047f19c..a393d9a90a18 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSource.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSource.java @@ -23,7 +23,6 @@ * *
  * Google Cloud Storage location for input content.
- * format.
  * 
* * Protobuf type {@code google.cloud.retail.v2beta.GcsSource} @@ -237,10 +236,10 @@ public com.google.protobuf.ByteString getInputUrisBytes(int index) { * * `user_event_ga360`: Using * https://support.google.com/analytics/answer/3437719. * Supported values for control imports: - * * 'control' (default): One JSON + * * `control` (default): One JSON * [Control][google.cloud.retail.v2beta.Control] per line. * Supported values for catalog attribute imports: - * * 'catalog_attribute' (default): One CSV + * * `catalog_attribute` (default): One CSV * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line. * * @@ -277,10 +276,10 @@ public java.lang.String getDataSchema() { * * `user_event_ga360`: Using * https://support.google.com/analytics/answer/3437719. * Supported values for control imports: - * * 'control' (default): One JSON + * * `control` (default): One JSON * [Control][google.cloud.retail.v2beta.Control] per line. * Supported values for catalog attribute imports: - * * 'catalog_attribute' (default): One CSV + * * `catalog_attribute` (default): One CSV * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line. * * @@ -480,7 +479,6 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * *
    * Google Cloud Storage location for input content.
-   * format.
    * 
* * Protobuf type {@code google.cloud.retail.v2beta.GcsSource} @@ -902,10 +900,10 @@ public Builder addInputUrisBytes(com.google.protobuf.ByteString value) { * * `user_event_ga360`: Using * https://support.google.com/analytics/answer/3437719. * Supported values for control imports: - * * 'control' (default): One JSON + * * `control` (default): One JSON * [Control][google.cloud.retail.v2beta.Control] per line. * Supported values for catalog attribute imports: - * * 'catalog_attribute' (default): One CSV + * * `catalog_attribute` (default): One CSV * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line. * * @@ -941,10 +939,10 @@ public java.lang.String getDataSchema() { * * `user_event_ga360`: Using * https://support.google.com/analytics/answer/3437719. * Supported values for control imports: - * * 'control' (default): One JSON + * * `control` (default): One JSON * [Control][google.cloud.retail.v2beta.Control] per line. * Supported values for catalog attribute imports: - * * 'catalog_attribute' (default): One CSV + * * `catalog_attribute` (default): One CSV * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line. * * @@ -980,10 +978,10 @@ public com.google.protobuf.ByteString getDataSchemaBytes() { * * `user_event_ga360`: Using * https://support.google.com/analytics/answer/3437719. * Supported values for control imports: - * * 'control' (default): One JSON + * * `control` (default): One JSON * [Control][google.cloud.retail.v2beta.Control] per line. * Supported values for catalog attribute imports: - * * 'catalog_attribute' (default): One CSV + * * `catalog_attribute` (default): One CSV * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line. * * @@ -1018,10 +1016,10 @@ public Builder setDataSchema(java.lang.String value) { * * `user_event_ga360`: Using * https://support.google.com/analytics/answer/3437719. * Supported values for control imports: - * * 'control' (default): One JSON + * * `control` (default): One JSON * [Control][google.cloud.retail.v2beta.Control] per line. * Supported values for catalog attribute imports: - * * 'catalog_attribute' (default): One CSV + * * `catalog_attribute` (default): One CSV * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line. * * @@ -1052,10 +1050,10 @@ public Builder clearDataSchema() { * * `user_event_ga360`: Using * https://support.google.com/analytics/answer/3437719. * Supported values for control imports: - * * 'control' (default): One JSON + * * `control` (default): One JSON * [Control][google.cloud.retail.v2beta.Control] per line. * Supported values for catalog attribute imports: - * * 'catalog_attribute' (default): One CSV + * * `catalog_attribute` (default): One CSV * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line. * * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSourceOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSourceOrBuilder.java index 7b16c116fa0f..104df643b9f0 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSourceOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GcsSourceOrBuilder.java @@ -119,10 +119,10 @@ public interface GcsSourceOrBuilder * * `user_event_ga360`: Using * https://support.google.com/analytics/answer/3437719. * Supported values for control imports: - * * 'control' (default): One JSON + * * `control` (default): One JSON * [Control][google.cloud.retail.v2beta.Control] per line. * Supported values for catalog attribute imports: - * * 'catalog_attribute' (default): One CSV + * * `catalog_attribute` (default): One CSV * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line. * * @@ -148,10 +148,10 @@ public interface GcsSourceOrBuilder * * `user_event_ga360`: Using * https://support.google.com/analytics/answer/3437719. * Supported values for control imports: - * * 'control' (default): One JSON + * * `control` (default): One JSON * [Control][google.cloud.retail.v2beta.Control] per line. * Supported values for catalog attribute imports: - * * 'catalog_attribute' (default): One CSV + * * `catalog_attribute` (default): One CSV * [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line. * * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequest.java index fe43495a366b..bcebed27c33b 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequest.java @@ -122,7 +122,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. Full CompletionConfig resource name. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
    * 
* * @@ -148,7 +148,7 @@ public java.lang.String getName() { * *
    * Required. Full CompletionConfig resource name. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
    * 
* * @@ -497,7 +497,7 @@ public Builder mergeFrom( * *
      * Required. Full CompletionConfig resource name. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
      * 
* * @@ -522,7 +522,7 @@ public java.lang.String getName() { * *
      * Required. Full CompletionConfig resource name. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
      * 
* * @@ -547,7 +547,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
      * Required. Full CompletionConfig resource name. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
      * 
* * @@ -571,7 +571,7 @@ public Builder setName(java.lang.String value) { * *
      * Required. Full CompletionConfig resource name. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
      * 
* * @@ -591,7 +591,7 @@ public Builder clearName() { * *
      * Required. Full CompletionConfig resource name. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
      * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequestOrBuilder.java index 5beb82f4ce95..8506df18ee67 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetCompletionConfigRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface GetCompletionConfigRequestOrBuilder * *
    * Required. Full CompletionConfig resource name. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
    * 
* * @@ -43,7 +43,7 @@ public interface GetCompletionConfigRequestOrBuilder * *
    * Required. Full CompletionConfig resource name. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
    * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequest.java index 7737aee34c3e..1f884a1c031c 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequest.java @@ -119,7 +119,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The resource name of the Control to delete. Format:
+   * Required. The resource name of the Control to get. Format:
    * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`
    * 
* @@ -145,7 +145,7 @@ public java.lang.String getName() { * * *
-   * Required. The resource name of the Control to delete. Format:
+   * Required. The resource name of the Control to get. Format:
    * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`
    * 
* @@ -490,7 +490,7 @@ public Builder mergeFrom( * * *
-     * Required. The resource name of the Control to delete. Format:
+     * Required. The resource name of the Control to get. Format:
      * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`
      * 
* @@ -515,7 +515,7 @@ public java.lang.String getName() { * * *
-     * Required. The resource name of the Control to delete. Format:
+     * Required. The resource name of the Control to get. Format:
      * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`
      * 
* @@ -540,7 +540,7 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Required. The resource name of the Control to delete. Format:
+     * Required. The resource name of the Control to get. Format:
      * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`
      * 
* @@ -564,7 +564,7 @@ public Builder setName(java.lang.String value) { * * *
-     * Required. The resource name of the Control to delete. Format:
+     * Required. The resource name of the Control to get. Format:
      * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`
      * 
* @@ -584,7 +584,7 @@ public Builder clearName() { * * *
-     * Required. The resource name of the Control to delete. Format:
+     * Required. The resource name of the Control to get. Format:
      * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`
      * 
* diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequestOrBuilder.java index 7b04cb9e1226..01a10c8df531 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetControlRequestOrBuilder.java @@ -27,7 +27,7 @@ public interface GetControlRequestOrBuilder * * *
-   * Required. The resource name of the Control to delete. Format:
+   * Required. The resource name of the Control to get. Format:
    * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`
    * 
* @@ -42,7 +42,7 @@ public interface GetControlRequestOrBuilder * * *
-   * Required. The resource name of the Control to delete. Format:
+   * Required. The resource name of the Control to get. Format:
    * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`
    * 
* diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequest.java index a47c19010ab6..9046e119e6bb 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequest.java @@ -120,7 +120,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The resource name of the ServingConfig to get. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -146,7 +146,7 @@ public java.lang.String getName() { * *
    * Required. The resource name of the ServingConfig to get. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -493,7 +493,7 @@ public Builder mergeFrom( * *
      * Required. The resource name of the ServingConfig to get. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -518,7 +518,7 @@ public java.lang.String getName() { * *
      * Required. The resource name of the ServingConfig to get. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -543,7 +543,7 @@ public com.google.protobuf.ByteString getNameBytes() { * *
      * Required. The resource name of the ServingConfig to get. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -567,7 +567,7 @@ public Builder setName(java.lang.String value) { * *
      * Required. The resource name of the ServingConfig to get. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -587,7 +587,7 @@ public Builder clearName() { * *
      * Required. The resource name of the ServingConfig to get. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequestOrBuilder.java index 4345869c8038..cee7bffd4709 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/GetServingConfigRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface GetServingConfigRequestOrBuilder * *
    * Required. The resource name of the ServingConfig to get. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -43,7 +43,7 @@ public interface GetServingConfigRequestOrBuilder * *
    * Required. The resource name of the ServingConfig to get. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequest.java index 4aa68aa6dddf..99a5599caa7f 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequest.java @@ -255,8 +255,8 @@ public com.google.cloud.retail.v2beta.CompletionDataInputConfig getInputConfig() * *
    * Pub/Sub topic for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
    * 
@@ -282,8 +282,8 @@ public java.lang.String getNotificationPubsubTopic() { * *
    * Pub/Sub topic for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
    * 
@@ -1002,8 +1002,8 @@ public Builder clearInputConfig() { * *
      * Pub/Sub topic for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
      * 
@@ -1028,8 +1028,8 @@ public java.lang.String getNotificationPubsubTopic() { * *
      * Pub/Sub topic for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
      * 
@@ -1054,8 +1054,8 @@ public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { * *
      * Pub/Sub topic for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
      * 
@@ -1079,8 +1079,8 @@ public Builder setNotificationPubsubTopic(java.lang.String value) { * *
      * Pub/Sub topic for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
      * 
@@ -1100,8 +1100,8 @@ public Builder clearNotificationPubsubTopic() { * *
      * Pub/Sub topic for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
      * 
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequestOrBuilder.java index 4b00a5f0af32..7d79680d1c6e 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportCompletionDataRequestOrBuilder.java @@ -100,8 +100,8 @@ public interface ImportCompletionDataRequestOrBuilder * *
    * Pub/Sub topic for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
    * 
@@ -116,8 +116,8 @@ public interface ImportCompletionDataRequestOrBuilder * *
    * Pub/Sub topic for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
    * 
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfig.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfig.java index 9c8d93fe7511..41837c6aac5d 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfig.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfig.java @@ -161,7 +161,7 @@ public DestinationCase getDestinationCase() { * *
    * Google Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
@@ -178,7 +178,7 @@ public boolean hasGcsPrefix() { * *
    * Google Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
@@ -208,7 +208,7 @@ public java.lang.String getGcsPrefix() { * *
    * Google Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
@@ -596,7 +596,7 @@ public Builder clearDestination() { * *
      * Google Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
@@ -614,7 +614,7 @@ public boolean hasGcsPrefix() { * *
      * Google Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
@@ -645,7 +645,7 @@ public java.lang.String getGcsPrefix() { * *
      * Google Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
@@ -676,7 +676,7 @@ public com.google.protobuf.ByteString getGcsPrefixBytes() { * *
      * Google Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
@@ -700,7 +700,7 @@ public Builder setGcsPrefix(java.lang.String value) { * *
      * Google Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
@@ -722,7 +722,7 @@ public Builder clearGcsPrefix() { * *
      * Google Cloud Storage prefix for import errors. This must be an empty,
-     * existing Cloud Storage directory. Import errors will be written to
+     * existing Cloud Storage directory. Import errors are written to
      * sharded files in this directory, one per line, as a JSON-encoded
      * `google.rpc.Status` message.
      * 
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfigOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfigOrBuilder.java index e202de4f8e71..097174b44ede 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfigOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportErrorsConfigOrBuilder.java @@ -28,7 +28,7 @@ public interface ImportErrorsConfigOrBuilder * *
    * Google Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
@@ -43,7 +43,7 @@ public interface ImportErrorsConfigOrBuilder * *
    * Google Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
@@ -58,7 +58,7 @@ public interface ImportErrorsConfigOrBuilder * *
    * Google Cloud Storage prefix for import errors. This must be an empty,
-   * existing Cloud Storage directory. Import errors will be written to
+   * existing Cloud Storage directory. Import errors are written to
    * sharded files in this directory, one per line, as a JSON-encoded
    * `google.rpc.Status` message.
    * 
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadata.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadata.java index b64a2977c2e0..387bc33028db 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadata.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadata.java @@ -22,7 +22,7 @@ * * *
- * Metadata related to the progress of the Import operation. This will be
+ * Metadata related to the progress of the Import operation. This is
  * returned by the google.longrunning.Operation.metadata field.
  * 
* @@ -305,7 +305,7 @@ public long getFailureCount() { * string request_id = 5 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportMetadata.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=348 + * google/cloud/retail/v2beta/import_config.proto;l=330 * @return The requestId. */ @java.lang.Override @@ -331,7 +331,7 @@ public java.lang.String getRequestId() { * string request_id = 5 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportMetadata.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=348 + * google/cloud/retail/v2beta/import_config.proto;l=330 * @return The bytes for requestId. */ @java.lang.Override @@ -355,8 +355,8 @@ public com.google.protobuf.ByteString getRequestIdBytes() { * *
    * Pub/Sub topic for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
    * 
@@ -382,8 +382,8 @@ public java.lang.String getNotificationPubsubTopic() { * *
    * Pub/Sub topic for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
    * 
@@ -623,7 +623,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Metadata related to the progress of the Import operation. This will be
+   * Metadata related to the progress of the Import operation. This is
    * returned by the google.longrunning.Operation.metadata field.
    * 
* @@ -1314,7 +1314,7 @@ public Builder clearFailureCount() { * string request_id = 5 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportMetadata.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=348 + * google/cloud/retail/v2beta/import_config.proto;l=330 * @return The requestId. */ @java.lang.Deprecated @@ -1339,7 +1339,7 @@ public java.lang.String getRequestId() { * string request_id = 5 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportMetadata.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=348 + * google/cloud/retail/v2beta/import_config.proto;l=330 * @return The bytes for requestId. */ @java.lang.Deprecated @@ -1364,7 +1364,7 @@ public com.google.protobuf.ByteString getRequestIdBytes() { * string request_id = 5 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportMetadata.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=348 + * google/cloud/retail/v2beta/import_config.proto;l=330 * @param value The requestId to set. * @return This builder for chaining. */ @@ -1388,7 +1388,7 @@ public Builder setRequestId(java.lang.String value) { * string request_id = 5 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportMetadata.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=348 + * google/cloud/retail/v2beta/import_config.proto;l=330 * @return This builder for chaining. */ @java.lang.Deprecated @@ -1408,7 +1408,7 @@ public Builder clearRequestId() { * string request_id = 5 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportMetadata.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=348 + * google/cloud/retail/v2beta/import_config.proto;l=330 * @param value The bytes for requestId to set. * @return This builder for chaining. */ @@ -1430,8 +1430,8 @@ public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { * *
      * Pub/Sub topic for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
      * 
@@ -1456,8 +1456,8 @@ public java.lang.String getNotificationPubsubTopic() { * *
      * Pub/Sub topic for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
      * 
@@ -1482,8 +1482,8 @@ public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { * *
      * Pub/Sub topic for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
      * 
@@ -1507,8 +1507,8 @@ public Builder setNotificationPubsubTopic(java.lang.String value) { * *
      * Pub/Sub topic for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
      * 
@@ -1528,8 +1528,8 @@ public Builder clearNotificationPubsubTopic() { * *
      * Pub/Sub topic for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
      * 
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadataOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadataOrBuilder.java index 81590ce98c6f..0ffba8872778 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadataOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportMetadataOrBuilder.java @@ -132,7 +132,7 @@ public interface ImportMetadataOrBuilder * string request_id = 5 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportMetadata.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=348 + * google/cloud/retail/v2beta/import_config.proto;l=330 * @return The requestId. */ @java.lang.Deprecated @@ -147,7 +147,7 @@ public interface ImportMetadataOrBuilder * string request_id = 5 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportMetadata.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=348 + * google/cloud/retail/v2beta/import_config.proto;l=330 * @return The bytes for requestId. */ @java.lang.Deprecated @@ -158,8 +158,8 @@ public interface ImportMetadataOrBuilder * *
    * Pub/Sub topic for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
    * 
@@ -174,8 +174,8 @@ public interface ImportMetadataOrBuilder * *
    * Pub/Sub topic for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
    * 
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequest.java index e519bc084c57..0c79a0bdc8c0 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequest.java @@ -223,14 +223,6 @@ public enum ReconciliationMode implements com.google.protobuf.ProtocolMessageEnu *
      * Calculates diff and replaces the entire product dataset. Existing
      * products may be deleted if they are not present in the source location.
-     * Can only be set while using
-     * [BigQuerySource][google.cloud.retail.v2beta.BigQuerySource]. And the
-     * BigQuery dataset must be created in the data location "us (multiple
-     * regions in United States)", otherwise a PERMISSION_DENIED error is
-     * thrown.
-     * Add the IAM permission "BigQuery Data Viewer" for
-     * cloud-retail-customer-data-access@system.gserviceaccount.com before
-     * using this feature otherwise an error is thrown.
      * 
* * FULL = 2; @@ -265,14 +257,6 @@ public enum ReconciliationMode implements com.google.protobuf.ProtocolMessageEnu *
      * Calculates diff and replaces the entire product dataset. Existing
      * products may be deleted if they are not present in the source location.
-     * Can only be set while using
-     * [BigQuerySource][google.cloud.retail.v2beta.BigQuerySource]. And the
-     * BigQuery dataset must be created in the data location "us (multiple
-     * regions in United States)", otherwise a PERMISSION_DENIED error is
-     * thrown.
-     * Add the IAM permission "BigQuery Data Viewer" for
-     * cloud-retail-customer-data-access@system.gserviceaccount.com before
-     * using this feature otherwise an error is thrown.
      * 
* * FULL = 2; @@ -438,7 +422,7 @@ public com.google.protobuf.ByteString getParentBytes() { * string request_id = 6 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportProductsRequest.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=202 + * google/cloud/retail/v2beta/import_config.proto;l=189 * @return The requestId. */ @java.lang.Override @@ -464,7 +448,7 @@ public java.lang.String getRequestId() { * string request_id = 6 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportProductsRequest.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=202 + * google/cloud/retail/v2beta/import_config.proto;l=189 * @return The bytes for requestId. */ @java.lang.Override @@ -589,8 +573,8 @@ public com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfi * * *
-   * Indicates which fields in the provided imported 'products' to update. If
-   * not set, will by default update all fields.
+   * Indicates which fields in the provided imported `products` to update. If
+   * not set, all fields are updated.
    * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -605,8 +589,8 @@ public boolean hasUpdateMask() { * * *
-   * Indicates which fields in the provided imported 'products' to update. If
-   * not set, will by default update all fields.
+   * Indicates which fields in the provided imported `products` to update. If
+   * not set, all fields are updated.
    * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -621,8 +605,8 @@ public com.google.protobuf.FieldMask getUpdateMask() { * * *
-   * Indicates which fields in the provided imported 'products' to update. If
-   * not set, will by default update all fields.
+   * Indicates which fields in the provided imported `products` to update. If
+   * not set, all fields are updated.
    * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -687,19 +671,15 @@ public int getReconciliationModeValue() { * *
    * Full Pub/Sub topic name for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
    * to be within the same project as
    * [ImportProductsRequest.parent][google.cloud.retail.v2beta.ImportProductsRequest.parent].
-   * Make sure that both
-   * `cloud-retail-customer-data-access@system.gserviceaccount.com` and
-   * `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
-   * have the `pubsub.topics.publish` IAM permission on the topic.
-   * Only supported when
-   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-   * is set to `FULL`.
+   * Make sure that `service-<project
+   * number>@gcp-sa-retail.iam.gserviceaccount.com` has the
+   * `pubsub.topics.publish` IAM permission on the topic.
    * 
* * string notification_pubsub_topic = 7; @@ -723,19 +703,15 @@ public java.lang.String getNotificationPubsubTopic() { * *
    * Full Pub/Sub topic name for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
    * to be within the same project as
    * [ImportProductsRequest.parent][google.cloud.retail.v2beta.ImportProductsRequest.parent].
-   * Make sure that both
-   * `cloud-retail-customer-data-access@system.gserviceaccount.com` and
-   * `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
-   * have the `pubsub.topics.publish` IAM permission on the topic.
-   * Only supported when
-   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-   * is set to `FULL`.
+   * Make sure that `service-<project
+   * number>@gcp-sa-retail.iam.gserviceaccount.com` has the
+   * `pubsub.topics.publish` IAM permission on the topic.
    * 
* * string notification_pubsub_topic = 7; @@ -1352,7 +1328,7 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { * string request_id = 6 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportProductsRequest.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=202 + * google/cloud/retail/v2beta/import_config.proto;l=189 * @return The requestId. */ @java.lang.Deprecated @@ -1377,7 +1353,7 @@ public java.lang.String getRequestId() { * string request_id = 6 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportProductsRequest.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=202 + * google/cloud/retail/v2beta/import_config.proto;l=189 * @return The bytes for requestId. */ @java.lang.Deprecated @@ -1402,7 +1378,7 @@ public com.google.protobuf.ByteString getRequestIdBytes() { * string request_id = 6 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportProductsRequest.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=202 + * google/cloud/retail/v2beta/import_config.proto;l=189 * @param value The requestId to set. * @return This builder for chaining. */ @@ -1426,7 +1402,7 @@ public Builder setRequestId(java.lang.String value) { * string request_id = 6 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportProductsRequest.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=202 + * google/cloud/retail/v2beta/import_config.proto;l=189 * @return This builder for chaining. */ @java.lang.Deprecated @@ -1446,7 +1422,7 @@ public Builder clearRequestId() { * string request_id = 6 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportProductsRequest.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=202 + * google/cloud/retail/v2beta/import_config.proto;l=189 * @param value The bytes for requestId to set. * @return This builder for chaining. */ @@ -1862,8 +1838,8 @@ public com.google.cloud.retail.v2beta.ImportErrorsConfigOrBuilder getErrorsConfi * * *
-     * Indicates which fields in the provided imported 'products' to update. If
-     * not set, will by default update all fields.
+     * Indicates which fields in the provided imported `products` to update. If
+     * not set, all fields are updated.
      * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -1877,8 +1853,8 @@ public boolean hasUpdateMask() { * * *
-     * Indicates which fields in the provided imported 'products' to update. If
-     * not set, will by default update all fields.
+     * Indicates which fields in the provided imported `products` to update. If
+     * not set, all fields are updated.
      * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -1898,8 +1874,8 @@ public com.google.protobuf.FieldMask getUpdateMask() { * * *
-     * Indicates which fields in the provided imported 'products' to update. If
-     * not set, will by default update all fields.
+     * Indicates which fields in the provided imported `products` to update. If
+     * not set, all fields are updated.
      * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -1921,8 +1897,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { * * *
-     * Indicates which fields in the provided imported 'products' to update. If
-     * not set, will by default update all fields.
+     * Indicates which fields in the provided imported `products` to update. If
+     * not set, all fields are updated.
      * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -1941,8 +1917,8 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal * * *
-     * Indicates which fields in the provided imported 'products' to update. If
-     * not set, will by default update all fields.
+     * Indicates which fields in the provided imported `products` to update. If
+     * not set, all fields are updated.
      * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -1966,8 +1942,8 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * * *
-     * Indicates which fields in the provided imported 'products' to update. If
-     * not set, will by default update all fields.
+     * Indicates which fields in the provided imported `products` to update. If
+     * not set, all fields are updated.
      * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -1987,8 +1963,8 @@ public Builder clearUpdateMask() { * * *
-     * Indicates which fields in the provided imported 'products' to update. If
-     * not set, will by default update all fields.
+     * Indicates which fields in the provided imported `products` to update. If
+     * not set, all fields are updated.
      * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -2002,8 +1978,8 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { * * *
-     * Indicates which fields in the provided imported 'products' to update. If
-     * not set, will by default update all fields.
+     * Indicates which fields in the provided imported `products` to update. If
+     * not set, all fields are updated.
      * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -2021,8 +1997,8 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * * *
-     * Indicates which fields in the provided imported 'products' to update. If
-     * not set, will by default update all fields.
+     * Indicates which fields in the provided imported `products` to update. If
+     * not set, all fields are updated.
      * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -2166,19 +2142,15 @@ public Builder clearReconciliationMode() { * *
      * Full Pub/Sub topic name for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
      * to be within the same project as
      * [ImportProductsRequest.parent][google.cloud.retail.v2beta.ImportProductsRequest.parent].
-     * Make sure that both
-     * `cloud-retail-customer-data-access@system.gserviceaccount.com` and
-     * `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
-     * have the `pubsub.topics.publish` IAM permission on the topic.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Make sure that `service-<project
+     * number>@gcp-sa-retail.iam.gserviceaccount.com` has the
+     * `pubsub.topics.publish` IAM permission on the topic.
      * 
* * string notification_pubsub_topic = 7; @@ -2201,19 +2173,15 @@ public java.lang.String getNotificationPubsubTopic() { * *
      * Full Pub/Sub topic name for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
      * to be within the same project as
      * [ImportProductsRequest.parent][google.cloud.retail.v2beta.ImportProductsRequest.parent].
-     * Make sure that both
-     * `cloud-retail-customer-data-access@system.gserviceaccount.com` and
-     * `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
-     * have the `pubsub.topics.publish` IAM permission on the topic.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Make sure that `service-<project
+     * number>@gcp-sa-retail.iam.gserviceaccount.com` has the
+     * `pubsub.topics.publish` IAM permission on the topic.
      * 
* * string notification_pubsub_topic = 7; @@ -2236,19 +2204,15 @@ public com.google.protobuf.ByteString getNotificationPubsubTopicBytes() { * *
      * Full Pub/Sub topic name for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
      * to be within the same project as
      * [ImportProductsRequest.parent][google.cloud.retail.v2beta.ImportProductsRequest.parent].
-     * Make sure that both
-     * `cloud-retail-customer-data-access@system.gserviceaccount.com` and
-     * `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
-     * have the `pubsub.topics.publish` IAM permission on the topic.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Make sure that `service-<project
+     * number>@gcp-sa-retail.iam.gserviceaccount.com` has the
+     * `pubsub.topics.publish` IAM permission on the topic.
      * 
* * string notification_pubsub_topic = 7; @@ -2270,19 +2234,15 @@ public Builder setNotificationPubsubTopic(java.lang.String value) { * *
      * Full Pub/Sub topic name for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
      * to be within the same project as
      * [ImportProductsRequest.parent][google.cloud.retail.v2beta.ImportProductsRequest.parent].
-     * Make sure that both
-     * `cloud-retail-customer-data-access@system.gserviceaccount.com` and
-     * `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
-     * have the `pubsub.topics.publish` IAM permission on the topic.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Make sure that `service-<project
+     * number>@gcp-sa-retail.iam.gserviceaccount.com` has the
+     * `pubsub.topics.publish` IAM permission on the topic.
      * 
* * string notification_pubsub_topic = 7; @@ -2300,19 +2260,15 @@ public Builder clearNotificationPubsubTopic() { * *
      * Full Pub/Sub topic name for receiving notification. If this field is set,
-     * when the import is finished, a notification will be sent to
-     * specified Pub/Sub topic. The message data will be JSON string of a
+     * when the import is finished, a notification is sent to
+     * specified Pub/Sub topic. The message data is JSON string of a
      * [Operation][google.longrunning.Operation].
      * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
      * to be within the same project as
      * [ImportProductsRequest.parent][google.cloud.retail.v2beta.ImportProductsRequest.parent].
-     * Make sure that both
-     * `cloud-retail-customer-data-access@system.gserviceaccount.com` and
-     * `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
-     * have the `pubsub.topics.publish` IAM permission on the topic.
-     * Only supported when
-     * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-     * is set to `FULL`.
+     * Make sure that `service-<project
+     * number>@gcp-sa-retail.iam.gserviceaccount.com` has the
+     * `pubsub.topics.publish` IAM permission on the topic.
      * 
* * string notification_pubsub_topic = 7; diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequestOrBuilder.java index 4cc3c26f0efd..7f5c0aefc747 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ImportProductsRequestOrBuilder.java @@ -68,7 +68,7 @@ public interface ImportProductsRequestOrBuilder * string request_id = 6 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportProductsRequest.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=202 + * google/cloud/retail/v2beta/import_config.proto;l=189 * @return The requestId. */ @java.lang.Deprecated @@ -83,7 +83,7 @@ public interface ImportProductsRequestOrBuilder * string request_id = 6 [deprecated = true]; * * @deprecated google.cloud.retail.v2beta.ImportProductsRequest.request_id is deprecated. See - * google/cloud/retail/v2beta/import_config.proto;l=202 + * google/cloud/retail/v2beta/import_config.proto;l=189 * @return The bytes for requestId. */ @java.lang.Deprecated @@ -169,8 +169,8 @@ public interface ImportProductsRequestOrBuilder * * *
-   * Indicates which fields in the provided imported 'products' to update. If
-   * not set, will by default update all fields.
+   * Indicates which fields in the provided imported `products` to update. If
+   * not set, all fields are updated.
    * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -182,8 +182,8 @@ public interface ImportProductsRequestOrBuilder * * *
-   * Indicates which fields in the provided imported 'products' to update. If
-   * not set, will by default update all fields.
+   * Indicates which fields in the provided imported `products` to update. If
+   * not set, all fields are updated.
    * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -195,8 +195,8 @@ public interface ImportProductsRequestOrBuilder * * *
-   * Indicates which fields in the provided imported 'products' to update. If
-   * not set, will by default update all fields.
+   * Indicates which fields in the provided imported `products` to update. If
+   * not set, all fields are updated.
    * 
* * .google.protobuf.FieldMask update_mask = 4; @@ -241,19 +241,15 @@ public interface ImportProductsRequestOrBuilder * *
    * Full Pub/Sub topic name for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
    * to be within the same project as
    * [ImportProductsRequest.parent][google.cloud.retail.v2beta.ImportProductsRequest.parent].
-   * Make sure that both
-   * `cloud-retail-customer-data-access@system.gserviceaccount.com` and
-   * `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
-   * have the `pubsub.topics.publish` IAM permission on the topic.
-   * Only supported when
-   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-   * is set to `FULL`.
+   * Make sure that `service-<project
+   * number>@gcp-sa-retail.iam.gserviceaccount.com` has the
+   * `pubsub.topics.publish` IAM permission on the topic.
    * 
* * string notification_pubsub_topic = 7; @@ -266,19 +262,15 @@ public interface ImportProductsRequestOrBuilder * *
    * Full Pub/Sub topic name for receiving notification. If this field is set,
-   * when the import is finished, a notification will be sent to
-   * specified Pub/Sub topic. The message data will be JSON string of a
+   * when the import is finished, a notification is sent to
+   * specified Pub/Sub topic. The message data is JSON string of a
    * [Operation][google.longrunning.Operation].
    * Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
    * to be within the same project as
    * [ImportProductsRequest.parent][google.cloud.retail.v2beta.ImportProductsRequest.parent].
-   * Make sure that both
-   * `cloud-retail-customer-data-access@system.gserviceaccount.com` and
-   * `service-<project number>@gcp-sa-retail.iam.gserviceaccount.com`
-   * have the `pubsub.topics.publish` IAM permission on the topic.
-   * Only supported when
-   * [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-   * is set to `FULL`.
+   * Make sure that `service-<project
+   * number>@gcp-sa-retail.iam.gserviceaccount.com` has the
+   * `pubsub.topics.publish` IAM permission on the topic.
    * 
* * string notification_pubsub_topic = 7; diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsRequest.java new file mode 100644 index 000000000000..6b1571c82182 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsRequest.java @@ -0,0 +1,945 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for listing models associated with a resource.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListModelsRequest} + */ +public final class ListModelsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ListModelsRequest) + ListModelsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListModelsRequest.newBuilder() to construct. + private ListModelsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListModelsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListModelsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListModelsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ListModelsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ListModelsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListModelsRequest.class, + com.google.cloud.retail.v2beta.ListModelsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent for which to list models.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent for which to list models.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. Maximum number of results to return. If unspecified, defaults
+   * to 50. Max allowed value is 1000.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. A page token, received from a previous `ListModels`
+   * call. Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. A page token, received from a previous `ListModels`
+   * call. Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + size += unknownFields.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.ListModelsRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ListModelsRequest other = + (com.google.cloud.retail.v2beta.ListModelsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ListModelsRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListModelsRequest 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.ListModelsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListModelsRequest 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.ListModelsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListModelsRequest 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.ListModelsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListModelsRequest 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.ListModelsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListModelsRequest 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.ListModelsRequest 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.ListModelsRequest 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.ListModelsRequest 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 for listing models associated with a resource.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListModelsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ListModelsRequest) + com.google.cloud.retail.v2beta.ListModelsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ListModelsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ListModelsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListModelsRequest.class, + com.google.cloud.retail.v2beta.ListModelsRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ListModelsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ListModelsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListModelsRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ListModelsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListModelsRequest build() { + com.google.cloud.retail.v2beta.ListModelsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListModelsRequest buildPartial() { + com.google.cloud.retail.v2beta.ListModelsRequest result = + new com.google.cloud.retail.v2beta.ListModelsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @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.ListModelsRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.ListModelsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ListModelsRequest other) { + if (other == com.google.cloud.retail.v2beta.ListModelsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.ListModelsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.ListModelsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent for which to list models.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent for which to list models.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent for which to list models.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent for which to list models.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent for which to list models.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Maximum number of results to return. If unspecified, defaults
+     * to 50. Max allowed value is 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Maximum number of results to return. If unspecified, defaults
+     * to 50. Max allowed value is 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Maximum number of results to return. If unspecified, defaults
+     * to 50. Max allowed value is 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A page token, received from a previous `ListModels`
+     * call. Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListModels`
+     * call. Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListModels`
+     * call. Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListModels`
+     * call. Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A page token, received from a previous `ListModels`
+     * call. Provide this to retrieve the subsequent page.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + 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.ListModelsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ListModelsRequest) + private static final com.google.cloud.retail.v2beta.ListModelsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ListModelsRequest(); + } + + public static com.google.cloud.retail.v2beta.ListModelsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListModelsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListModelsRequest(input, extensionRegistry); + } + }; + + 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.ListModelsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsRequestOrBuilder.java new file mode 100644 index 000000000000..1f4f30aabe2d --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public interface ListModelsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ListModelsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent for which to list models.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent for which to list models.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Maximum number of results to return. If unspecified, defaults
+   * to 50. Max allowed value is 1000.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A page token, received from a previous `ListModels`
+   * call. Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A page token, received from a previous `ListModels`
+   * call. Provide this to retrieve the subsequent page.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsResponse.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsResponse.java new file mode 100644 index 000000000000..8a97f2d5315e --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsResponse.java @@ -0,0 +1,1129 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response to a ListModelRequest.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListModelsResponse} + */ +public final class ListModelsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ListModelsResponse) + ListModelsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListModelsResponse.newBuilder() to construct. + private ListModelsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListModelsResponse() { + models_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListModelsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListModelsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + models_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + models_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Model.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + models_ = java.util.Collections.unmodifiableList(models_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ListModelsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ListModelsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListModelsResponse.class, + com.google.cloud.retail.v2beta.ListModelsResponse.Builder.class); + } + + public static final int MODELS_FIELD_NUMBER = 1; + private java.util.List models_; + /** + * + * + *
+   * List of Models.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + @java.lang.Override + public java.util.List getModelsList() { + return models_; + } + /** + * + * + *
+   * List of Models.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + @java.lang.Override + public java.util.List + getModelsOrBuilderList() { + return models_; + } + /** + * + * + *
+   * List of Models.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + @java.lang.Override + public int getModelsCount() { + return models_.size(); + } + /** + * + * + *
+   * List of Models.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model getModels(int index) { + return models_.get(index); + } + /** + * + * + *
+   * List of Models.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ModelOrBuilder getModelsOrBuilder(int index) { + return models_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Pagination token, if not returned indicates the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Pagination token, if not returned indicates the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < models_.size(); i++) { + output.writeMessage(1, models_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < models_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, models_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.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.ListModelsResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ListModelsResponse other = + (com.google.cloud.retail.v2beta.ListModelsResponse) obj; + + if (!getModelsList().equals(other.getModelsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getModelsCount() > 0) { + hash = (37 * hash) + MODELS_FIELD_NUMBER; + hash = (53 * hash) + getModelsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ListModelsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListModelsResponse 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.ListModelsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListModelsResponse 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.ListModelsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ListModelsResponse 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.ListModelsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListModelsResponse 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.ListModelsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ListModelsResponse 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.ListModelsResponse 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.ListModelsResponse 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.ListModelsResponse 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 to a ListModelRequest.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ListModelsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ListModelsResponse) + com.google.cloud.retail.v2beta.ListModelsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ListModelsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ListModelsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ListModelsResponse.class, + com.google.cloud.retail.v2beta.ListModelsResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ListModelsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getModelsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (modelsBuilder_ == null) { + models_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + modelsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ListModelsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListModelsResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ListModelsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListModelsResponse build() { + com.google.cloud.retail.v2beta.ListModelsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ListModelsResponse buildPartial() { + com.google.cloud.retail.v2beta.ListModelsResponse result = + new com.google.cloud.retail.v2beta.ListModelsResponse(this); + int from_bitField0_ = bitField0_; + if (modelsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + models_ = java.util.Collections.unmodifiableList(models_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.models_ = models_; + } else { + result.models_ = modelsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @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.ListModelsResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.ListModelsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ListModelsResponse other) { + if (other == com.google.cloud.retail.v2beta.ListModelsResponse.getDefaultInstance()) + return this; + if (modelsBuilder_ == null) { + if (!other.models_.isEmpty()) { + if (models_.isEmpty()) { + models_ = other.models_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureModelsIsMutable(); + models_.addAll(other.models_); + } + onChanged(); + } + } else { + if (!other.models_.isEmpty()) { + if (modelsBuilder_.isEmpty()) { + modelsBuilder_.dispose(); + modelsBuilder_ = null; + models_ = other.models_; + bitField0_ = (bitField0_ & ~0x00000001); + modelsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getModelsFieldBuilder() + : null; + } else { + modelsBuilder_.addAllMessages(other.models_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.ListModelsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ListModelsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List models_ = + java.util.Collections.emptyList(); + + private void ensureModelsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + models_ = new java.util.ArrayList(models_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Model, + com.google.cloud.retail.v2beta.Model.Builder, + com.google.cloud.retail.v2beta.ModelOrBuilder> + modelsBuilder_; + + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public java.util.List getModelsList() { + if (modelsBuilder_ == null) { + return java.util.Collections.unmodifiableList(models_); + } else { + return modelsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public int getModelsCount() { + if (modelsBuilder_ == null) { + return models_.size(); + } else { + return modelsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public com.google.cloud.retail.v2beta.Model getModels(int index) { + if (modelsBuilder_ == null) { + return models_.get(index); + } else { + return modelsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public Builder setModels(int index, com.google.cloud.retail.v2beta.Model value) { + if (modelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelsIsMutable(); + models_.set(index, value); + onChanged(); + } else { + modelsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public Builder setModels( + int index, com.google.cloud.retail.v2beta.Model.Builder builderForValue) { + if (modelsBuilder_ == null) { + ensureModelsIsMutable(); + models_.set(index, builderForValue.build()); + onChanged(); + } else { + modelsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public Builder addModels(com.google.cloud.retail.v2beta.Model value) { + if (modelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelsIsMutable(); + models_.add(value); + onChanged(); + } else { + modelsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public Builder addModels(int index, com.google.cloud.retail.v2beta.Model value) { + if (modelsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureModelsIsMutable(); + models_.add(index, value); + onChanged(); + } else { + modelsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public Builder addModels(com.google.cloud.retail.v2beta.Model.Builder builderForValue) { + if (modelsBuilder_ == null) { + ensureModelsIsMutable(); + models_.add(builderForValue.build()); + onChanged(); + } else { + modelsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public Builder addModels( + int index, com.google.cloud.retail.v2beta.Model.Builder builderForValue) { + if (modelsBuilder_ == null) { + ensureModelsIsMutable(); + models_.add(index, builderForValue.build()); + onChanged(); + } else { + modelsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public Builder addAllModels( + java.lang.Iterable values) { + if (modelsBuilder_ == null) { + ensureModelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, models_); + onChanged(); + } else { + modelsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public Builder clearModels() { + if (modelsBuilder_ == null) { + models_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + modelsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public Builder removeModels(int index) { + if (modelsBuilder_ == null) { + ensureModelsIsMutable(); + models_.remove(index); + onChanged(); + } else { + modelsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public com.google.cloud.retail.v2beta.Model.Builder getModelsBuilder(int index) { + return getModelsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public com.google.cloud.retail.v2beta.ModelOrBuilder getModelsOrBuilder(int index) { + if (modelsBuilder_ == null) { + return models_.get(index); + } else { + return modelsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public java.util.List + getModelsOrBuilderList() { + if (modelsBuilder_ != null) { + return modelsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(models_); + } + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public com.google.cloud.retail.v2beta.Model.Builder addModelsBuilder() { + return getModelsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Model.getDefaultInstance()); + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public com.google.cloud.retail.v2beta.Model.Builder addModelsBuilder(int index) { + return getModelsFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.Model.getDefaultInstance()); + } + /** + * + * + *
+     * List of Models.
+     * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + public java.util.List getModelsBuilderList() { + return getModelsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Model, + com.google.cloud.retail.v2beta.Model.Builder, + com.google.cloud.retail.v2beta.ModelOrBuilder> + getModelsFieldBuilder() { + if (modelsBuilder_ == null) { + modelsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Model, + com.google.cloud.retail.v2beta.Model.Builder, + com.google.cloud.retail.v2beta.ModelOrBuilder>( + models_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + models_ = null; + } + return modelsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Pagination token, if not returned indicates the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Pagination token, if not returned indicates the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Pagination token, if not returned indicates the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Pagination token, if not returned indicates the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Pagination token, if not returned indicates the last page.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + 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.ListModelsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ListModelsResponse) + private static final com.google.cloud.retail.v2beta.ListModelsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ListModelsResponse(); + } + + public static com.google.cloud.retail.v2beta.ListModelsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListModelsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListModelsResponse(input, extensionRegistry); + } + }; + + 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.ListModelsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsResponseOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsResponseOrBuilder.java new file mode 100644 index 000000000000..877219100918 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListModelsResponseOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public interface ListModelsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ListModelsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of Models.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + java.util.List getModelsList(); + /** + * + * + *
+   * List of Models.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + com.google.cloud.retail.v2beta.Model getModels(int index); + /** + * + * + *
+   * List of Models.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + int getModelsCount(); + /** + * + * + *
+   * List of Models.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + java.util.List getModelsOrBuilderList(); + /** + * + * + *
+   * List of Models.
+   * 
+ * + * repeated .google.cloud.retail.v2beta.Model models = 1; + */ + com.google.cloud.retail.v2beta.ModelOrBuilder getModelsOrBuilder(int index); + + /** + * + * + *
+   * Pagination token, if not returned indicates the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Pagination token, if not returned indicates the last page.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequest.java index f00da7bc0fc8..e896b1706297 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequest.java @@ -133,7 +133,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The catalog resource name. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
    * 
* * @@ -159,7 +159,7 @@ public java.lang.String getParent() { * *
    * Required. The catalog resource name. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
    * 
* * @@ -608,7 +608,7 @@ public Builder mergeFrom( * *
      * Required. The catalog resource name. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
      * 
* * @@ -633,7 +633,7 @@ public java.lang.String getParent() { * *
      * Required. The catalog resource name. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
      * 
* * @@ -658,7 +658,7 @@ public com.google.protobuf.ByteString getParentBytes() { * *
      * Required. The catalog resource name. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
      * 
* * @@ -682,7 +682,7 @@ public Builder setParent(java.lang.String value) { * *
      * Required. The catalog resource name. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
      * 
* * @@ -702,7 +702,7 @@ public Builder clearParent() { * *
      * Required. The catalog resource name. Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
      * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequestOrBuilder.java index 1ff86f63a48e..04eeddcb9d10 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ListServingConfigsRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface ListServingConfigsRequestOrBuilder * *
    * Required. The catalog resource name. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
    * 
* * @@ -43,7 +43,7 @@ public interface ListServingConfigsRequestOrBuilder * *
    * Required. The catalog resource name. Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
    * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLink.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLink.java index a792c9b2f246..8984110e4f4e 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLink.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLink.java @@ -235,8 +235,8 @@ public com.google.protobuf.ByteString getBranchIdBytes() { * *
    * String representing the destination to import for, all if left empty.
-   * List of possible values can be found here.
-   * [https://support.google.com/merchants/answer/7501026]
+   * List of possible values is given in [Included
+   * destination](https://support.google.com/merchants/answer/7501026).
    * List of allowed string values:
    * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
    * _ads", "Free_listings", "Free_local_listings"
@@ -255,8 +255,8 @@ public com.google.protobuf.ProtocolStringList getDestinationsList() {
    *
    * 
    * String representing the destination to import for, all if left empty.
-   * List of possible values can be found here.
-   * [https://support.google.com/merchants/answer/7501026]
+   * List of possible values is given in [Included
+   * destination](https://support.google.com/merchants/answer/7501026).
    * List of allowed string values:
    * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
    * _ads", "Free_listings", "Free_local_listings"
@@ -275,8 +275,8 @@ public int getDestinationsCount() {
    *
    * 
    * String representing the destination to import for, all if left empty.
-   * List of possible values can be found here.
-   * [https://support.google.com/merchants/answer/7501026]
+   * List of possible values is given in [Included
+   * destination](https://support.google.com/merchants/answer/7501026).
    * List of allowed string values:
    * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
    * _ads", "Free_listings", "Free_local_listings"
@@ -296,8 +296,8 @@ public java.lang.String getDestinations(int index) {
    *
    * 
    * String representing the destination to import for, all if left empty.
-   * List of possible values can be found here.
-   * [https://support.google.com/merchants/answer/7501026]
+   * List of possible values is given in [Included
+   * destination](https://support.google.com/merchants/answer/7501026).
    * List of allowed string values:
    * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
    * _ads", "Free_listings", "Free_local_listings"
@@ -1032,8 +1032,8 @@ private void ensureDestinationsIsMutable() {
      *
      * 
      * String representing the destination to import for, all if left empty.
-     * List of possible values can be found here.
-     * [https://support.google.com/merchants/answer/7501026]
+     * List of possible values is given in [Included
+     * destination](https://support.google.com/merchants/answer/7501026).
      * List of allowed string values:
      * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
      * _ads", "Free_listings", "Free_local_listings"
@@ -1052,8 +1052,8 @@ public com.google.protobuf.ProtocolStringList getDestinationsList() {
      *
      * 
      * String representing the destination to import for, all if left empty.
-     * List of possible values can be found here.
-     * [https://support.google.com/merchants/answer/7501026]
+     * List of possible values is given in [Included
+     * destination](https://support.google.com/merchants/answer/7501026).
      * List of allowed string values:
      * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
      * _ads", "Free_listings", "Free_local_listings"
@@ -1072,8 +1072,8 @@ public int getDestinationsCount() {
      *
      * 
      * String representing the destination to import for, all if left empty.
-     * List of possible values can be found here.
-     * [https://support.google.com/merchants/answer/7501026]
+     * List of possible values is given in [Included
+     * destination](https://support.google.com/merchants/answer/7501026).
      * List of allowed string values:
      * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
      * _ads", "Free_listings", "Free_local_listings"
@@ -1093,8 +1093,8 @@ public java.lang.String getDestinations(int index) {
      *
      * 
      * String representing the destination to import for, all if left empty.
-     * List of possible values can be found here.
-     * [https://support.google.com/merchants/answer/7501026]
+     * List of possible values is given in [Included
+     * destination](https://support.google.com/merchants/answer/7501026).
      * List of allowed string values:
      * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
      * _ads", "Free_listings", "Free_local_listings"
@@ -1114,8 +1114,8 @@ public com.google.protobuf.ByteString getDestinationsBytes(int index) {
      *
      * 
      * String representing the destination to import for, all if left empty.
-     * List of possible values can be found here.
-     * [https://support.google.com/merchants/answer/7501026]
+     * List of possible values is given in [Included
+     * destination](https://support.google.com/merchants/answer/7501026).
      * List of allowed string values:
      * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
      * _ads", "Free_listings", "Free_local_listings"
@@ -1142,8 +1142,8 @@ public Builder setDestinations(int index, java.lang.String value) {
      *
      * 
      * String representing the destination to import for, all if left empty.
-     * List of possible values can be found here.
-     * [https://support.google.com/merchants/answer/7501026]
+     * List of possible values is given in [Included
+     * destination](https://support.google.com/merchants/answer/7501026).
      * List of allowed string values:
      * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
      * _ads", "Free_listings", "Free_local_listings"
@@ -1169,8 +1169,8 @@ public Builder addDestinations(java.lang.String value) {
      *
      * 
      * String representing the destination to import for, all if left empty.
-     * List of possible values can be found here.
-     * [https://support.google.com/merchants/answer/7501026]
+     * List of possible values is given in [Included
+     * destination](https://support.google.com/merchants/answer/7501026).
      * List of allowed string values:
      * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
      * _ads", "Free_listings", "Free_local_listings"
@@ -1193,8 +1193,8 @@ public Builder addAllDestinations(java.lang.Iterable values) {
      *
      * 
      * String representing the destination to import for, all if left empty.
-     * List of possible values can be found here.
-     * [https://support.google.com/merchants/answer/7501026]
+     * List of possible values is given in [Included
+     * destination](https://support.google.com/merchants/answer/7501026).
      * List of allowed string values:
      * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
      * _ads", "Free_listings", "Free_local_listings"
@@ -1216,8 +1216,8 @@ public Builder clearDestinations() {
      *
      * 
      * String representing the destination to import for, all if left empty.
-     * List of possible values can be found here.
-     * [https://support.google.com/merchants/answer/7501026]
+     * List of possible values is given in [Included
+     * destination](https://support.google.com/merchants/answer/7501026).
      * List of allowed string values:
      * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
      * _ads", "Free_listings", "Free_local_listings"
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkOrBuilder.java
index 5c2cbbd13614..0fb134c8d448 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkOrBuilder.java
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/MerchantCenterLinkOrBuilder.java
@@ -76,8 +76,8 @@ public interface MerchantCenterLinkOrBuilder
    *
    * 
    * String representing the destination to import for, all if left empty.
-   * List of possible values can be found here.
-   * [https://support.google.com/merchants/answer/7501026]
+   * List of possible values is given in [Included
+   * destination](https://support.google.com/merchants/answer/7501026).
    * List of allowed string values:
    * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
    * _ads", "Free_listings", "Free_local_listings"
@@ -94,8 +94,8 @@ public interface MerchantCenterLinkOrBuilder
    *
    * 
    * String representing the destination to import for, all if left empty.
-   * List of possible values can be found here.
-   * [https://support.google.com/merchants/answer/7501026]
+   * List of possible values is given in [Included
+   * destination](https://support.google.com/merchants/answer/7501026).
    * List of allowed string values:
    * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
    * _ads", "Free_listings", "Free_local_listings"
@@ -112,8 +112,8 @@ public interface MerchantCenterLinkOrBuilder
    *
    * 
    * String representing the destination to import for, all if left empty.
-   * List of possible values can be found here.
-   * [https://support.google.com/merchants/answer/7501026]
+   * List of possible values is given in [Included
+   * destination](https://support.google.com/merchants/answer/7501026).
    * List of allowed string values:
    * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
    * _ads", "Free_listings", "Free_local_listings"
@@ -131,8 +131,8 @@ public interface MerchantCenterLinkOrBuilder
    *
    * 
    * String representing the destination to import for, all if left empty.
-   * List of possible values can be found here.
-   * [https://support.google.com/merchants/answer/7501026]
+   * List of possible values is given in [Included
+   * destination](https://support.google.com/merchants/answer/7501026).
    * List of allowed string values:
    * "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
    * _ads", "Free_listings", "Free_local_listings"
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Model.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Model.java
new file mode 100644
index 000000000000..744cd903da49
--- /dev/null
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Model.java
@@ -0,0 +1,5595 @@
+/*
+ * Copyright 2020 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/model.proto
+
+package com.google.cloud.retail.v2beta;
+
+/**
+ *
+ *
+ * 
+ * Metadata that describes the training and serving parameters of a
+ * [Model][google.cloud.retail.v2beta.Model]. A
+ * [Model][google.cloud.retail.v2beta.Model] can be associated with a
+ * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] and then queried
+ * through the Predict API.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Model} + */ +public final class Model extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Model) + ModelOrBuilder { + private static final long serialVersionUID = 0L; + // Use Model.newBuilder() to construct. + private Model(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Model() { + name_ = ""; + displayName_ = ""; + trainingState_ = 0; + servingState_ = 0; + type_ = ""; + optimizationObjective_ = ""; + periodicTuningState_ = 0; + tuningOperation_ = ""; + dataState_ = 0; + filteringOption_ = 0; + servingConfigLists_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Model(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Model( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + trainingState_ = rawValue; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + servingState_ = rawValue; + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + optimizationObjective_ = s; + break; + } + case 88: + { + int rawValue = input.readEnum(); + + periodicTuningState_ = rawValue; + break; + } + case 98: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (lastTuneTime_ != null) { + subBuilder = lastTuneTime_.toBuilder(); + } + lastTuneTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(lastTuneTime_); + lastTuneTime_ = subBuilder.buildPartial(); + } + + break; + } + case 122: + { + java.lang.String s = input.readStringRequireUtf8(); + + tuningOperation_ = s; + break; + } + case 128: + { + int rawValue = input.readEnum(); + + dataState_ = rawValue; + break; + } + case 144: + { + int rawValue = input.readEnum(); + + filteringOption_ = rawValue; + break; + } + case 154: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + servingConfigLists_ = + new java.util.ArrayList< + com.google.cloud.retail.v2beta.Model.ServingConfigList>(); + mutable_bitField0_ |= 0x00000001; + } + servingConfigLists_.add( + input.readMessage( + com.google.cloud.retail.v2beta.Model.ServingConfigList.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + servingConfigLists_ = java.util.Collections.unmodifiableList(servingConfigLists_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelProto + .internal_static_google_cloud_retail_v2beta_Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelProto + .internal_static_google_cloud_retail_v2beta_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Model.class, + com.google.cloud.retail.v2beta.Model.Builder.class); + } + + /** + * + * + *
+   * The serving state of the model.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.Model.ServingState} + */ + public enum ServingState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified serving state.
+     * 
+ * + * SERVING_STATE_UNSPECIFIED = 0; + */ + SERVING_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The model is not serving.
+     * 
+ * + * INACTIVE = 1; + */ + INACTIVE(1), + /** + * + * + *
+     * The model is serving and can be queried.
+     * 
+ * + * ACTIVE = 2; + */ + ACTIVE(2), + /** + * + * + *
+     * The model is trained on tuned hyperparameters and can be
+     * queried.
+     * 
+ * + * TUNED = 3; + */ + TUNED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified serving state.
+     * 
+ * + * SERVING_STATE_UNSPECIFIED = 0; + */ + public static final int SERVING_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The model is not serving.
+     * 
+ * + * INACTIVE = 1; + */ + public static final int INACTIVE_VALUE = 1; + /** + * + * + *
+     * The model is serving and can be queried.
+     * 
+ * + * ACTIVE = 2; + */ + public static final int ACTIVE_VALUE = 2; + /** + * + * + *
+     * The model is trained on tuned hyperparameters and can be
+     * queried.
+     * 
+ * + * TUNED = 3; + */ + public static final int TUNED_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ServingState valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ServingState forNumber(int value) { + switch (value) { + case 0: + return SERVING_STATE_UNSPECIFIED; + case 1: + return INACTIVE; + case 2: + return ACTIVE; + case 3: + return TUNED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ServingState findValueByNumber(int number) { + return ServingState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.retail.v2beta.Model.getDescriptor().getEnumTypes().get(0); + } + + private static final ServingState[] VALUES = values(); + + public static ServingState valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ServingState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.Model.ServingState) + } + + /** + * + * + *
+   * The training state of the model.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.Model.TrainingState} + */ + public enum TrainingState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified training state.
+     * 
+ * + * TRAINING_STATE_UNSPECIFIED = 0; + */ + TRAINING_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The model training is paused.
+     * 
+ * + * PAUSED = 1; + */ + PAUSED(1), + /** + * + * + *
+     * The model is training.
+     * 
+ * + * TRAINING = 2; + */ + TRAINING(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified training state.
+     * 
+ * + * TRAINING_STATE_UNSPECIFIED = 0; + */ + public static final int TRAINING_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The model training is paused.
+     * 
+ * + * PAUSED = 1; + */ + public static final int PAUSED_VALUE = 1; + /** + * + * + *
+     * The model is training.
+     * 
+ * + * TRAINING = 2; + */ + public static final int TRAINING_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TrainingState valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static TrainingState forNumber(int value) { + switch (value) { + case 0: + return TRAINING_STATE_UNSPECIFIED; + case 1: + return PAUSED; + case 2: + return TRAINING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TrainingState findValueByNumber(int number) { + return TrainingState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.retail.v2beta.Model.getDescriptor().getEnumTypes().get(1); + } + + private static final TrainingState[] VALUES = values(); + + public static TrainingState valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private TrainingState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.Model.TrainingState) + } + + /** + * + * + *
+   * Describes whether periodic tuning is enabled for this model
+   * or not. Periodic tuning is scheduled at most every three months. You can
+   * start a tuning process manually by using the `TuneModel`
+   * method, which starts a tuning process immediately and resets the quarterly
+   * schedule. Enabling or disabling periodic tuning does not affect any
+   * current tuning processes.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.Model.PeriodicTuningState} + */ + public enum PeriodicTuningState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified default value, should never be explicitly set.
+     * 
+ * + * PERIODIC_TUNING_STATE_UNSPECIFIED = 0; + */ + PERIODIC_TUNING_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The model has periodic tuning disabled. Tuning
+     * can be reenabled by calling the `EnableModelPeriodicTuning`
+     * method or by calling the `TuneModel` method.
+     * 
+ * + * PERIODIC_TUNING_DISABLED = 1; + */ + PERIODIC_TUNING_DISABLED(1), + /** + * + * + *
+     * The model cannot be tuned with periodic tuning OR the
+     * `TuneModel` method. Hide the options in customer UI and
+     * reject any requests through the backend self serve API.
+     * 
+ * + * ALL_TUNING_DISABLED = 3; + */ + ALL_TUNING_DISABLED(3), + /** + * + * + *
+     * The model has periodic tuning enabled. Tuning
+     * can be disabled by calling the `DisableModelPeriodicTuning`
+     * method.
+     * 
+ * + * PERIODIC_TUNING_ENABLED = 2; + */ + PERIODIC_TUNING_ENABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified default value, should never be explicitly set.
+     * 
+ * + * PERIODIC_TUNING_STATE_UNSPECIFIED = 0; + */ + public static final int PERIODIC_TUNING_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The model has periodic tuning disabled. Tuning
+     * can be reenabled by calling the `EnableModelPeriodicTuning`
+     * method or by calling the `TuneModel` method.
+     * 
+ * + * PERIODIC_TUNING_DISABLED = 1; + */ + public static final int PERIODIC_TUNING_DISABLED_VALUE = 1; + /** + * + * + *
+     * The model cannot be tuned with periodic tuning OR the
+     * `TuneModel` method. Hide the options in customer UI and
+     * reject any requests through the backend self serve API.
+     * 
+ * + * ALL_TUNING_DISABLED = 3; + */ + public static final int ALL_TUNING_DISABLED_VALUE = 3; + /** + * + * + *
+     * The model has periodic tuning enabled. Tuning
+     * can be disabled by calling the `DisableModelPeriodicTuning`
+     * method.
+     * 
+ * + * PERIODIC_TUNING_ENABLED = 2; + */ + public static final int PERIODIC_TUNING_ENABLED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PeriodicTuningState valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static PeriodicTuningState forNumber(int value) { + switch (value) { + case 0: + return PERIODIC_TUNING_STATE_UNSPECIFIED; + case 1: + return PERIODIC_TUNING_DISABLED; + case 3: + return ALL_TUNING_DISABLED; + case 2: + return PERIODIC_TUNING_ENABLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public PeriodicTuningState findValueByNumber(int number) { + return PeriodicTuningState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.retail.v2beta.Model.getDescriptor().getEnumTypes().get(2); + } + + private static final PeriodicTuningState[] VALUES = values(); + + public static PeriodicTuningState valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private PeriodicTuningState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.Model.PeriodicTuningState) + } + + /** + * + * + *
+   * Describes whether this model have sufficient training data
+   * to be continuously trained.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.Model.DataState} + */ + public enum DataState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified default value, should never be explicitly set.
+     * 
+ * + * DATA_STATE_UNSPECIFIED = 0; + */ + DATA_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The model has sufficient training data.
+     * 
+ * + * DATA_OK = 1; + */ + DATA_OK(1), + /** + * + * + *
+     * The model does not have sufficient training data. Error
+     * messages can be queried via Stackdriver.
+     * 
+ * + * DATA_ERROR = 2; + */ + DATA_ERROR(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified default value, should never be explicitly set.
+     * 
+ * + * DATA_STATE_UNSPECIFIED = 0; + */ + public static final int DATA_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The model has sufficient training data.
+     * 
+ * + * DATA_OK = 1; + */ + public static final int DATA_OK_VALUE = 1; + /** + * + * + *
+     * The model does not have sufficient training data. Error
+     * messages can be queried via Stackdriver.
+     * 
+ * + * DATA_ERROR = 2; + */ + public static final int DATA_ERROR_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DataState valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DataState forNumber(int value) { + switch (value) { + case 0: + return DATA_STATE_UNSPECIFIED; + case 1: + return DATA_OK; + case 2: + return DATA_ERROR; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DataState findValueByNumber(int number) { + return DataState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.retail.v2beta.Model.getDescriptor().getEnumTypes().get(3); + } + + private static final DataState[] VALUES = values(); + + public static DataState valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private DataState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.Model.DataState) + } + + public interface ServingConfigListOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Model.ServingConfigList) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. A set of valid serving configs that may be used for
+     * `PAGE_OPTIMIZATION`.
+     * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the servingConfigIds. + */ + java.util.List getServingConfigIdsList(); + /** + * + * + *
+     * Optional. A set of valid serving configs that may be used for
+     * `PAGE_OPTIMIZATION`.
+     * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of servingConfigIds. + */ + int getServingConfigIdsCount(); + /** + * + * + *
+     * Optional. A set of valid serving configs that may be used for
+     * `PAGE_OPTIMIZATION`.
+     * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The servingConfigIds at the given index. + */ + java.lang.String getServingConfigIds(int index); + /** + * + * + *
+     * Optional. A set of valid serving configs that may be used for
+     * `PAGE_OPTIMIZATION`.
+     * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the servingConfigIds at the given index. + */ + com.google.protobuf.ByteString getServingConfigIdsBytes(int index); + } + /** + * + * + *
+   * Represents an ordered combination of valid serving configs, which
+   * can be used for `PAGE_OPTIMIZATION` recommendations.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Model.ServingConfigList} + */ + public static final class ServingConfigList extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.Model.ServingConfigList) + ServingConfigListOrBuilder { + private static final long serialVersionUID = 0L; + // Use ServingConfigList.newBuilder() to construct. + private ServingConfigList(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ServingConfigList() { + servingConfigIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ServingConfigList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ServingConfigList( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + servingConfigIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + servingConfigIds_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + servingConfigIds_ = servingConfigIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelProto + .internal_static_google_cloud_retail_v2beta_Model_ServingConfigList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelProto + .internal_static_google_cloud_retail_v2beta_Model_ServingConfigList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Model.ServingConfigList.class, + com.google.cloud.retail.v2beta.Model.ServingConfigList.Builder.class); + } + + public static final int SERVING_CONFIG_IDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList servingConfigIds_; + /** + * + * + *
+     * Optional. A set of valid serving configs that may be used for
+     * `PAGE_OPTIMIZATION`.
+     * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the servingConfigIds. + */ + public com.google.protobuf.ProtocolStringList getServingConfigIdsList() { + return servingConfigIds_; + } + /** + * + * + *
+     * Optional. A set of valid serving configs that may be used for
+     * `PAGE_OPTIMIZATION`.
+     * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of servingConfigIds. + */ + public int getServingConfigIdsCount() { + return servingConfigIds_.size(); + } + /** + * + * + *
+     * Optional. A set of valid serving configs that may be used for
+     * `PAGE_OPTIMIZATION`.
+     * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The servingConfigIds at the given index. + */ + public java.lang.String getServingConfigIds(int index) { + return servingConfigIds_.get(index); + } + /** + * + * + *
+     * Optional. A set of valid serving configs that may be used for
+     * `PAGE_OPTIMIZATION`.
+     * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the servingConfigIds at the given index. + */ + public com.google.protobuf.ByteString getServingConfigIdsBytes(int index) { + return servingConfigIds_.getByteString(index); + } + + 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 < servingConfigIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, servingConfigIds_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < servingConfigIds_.size(); i++) { + dataSize += computeStringSizeNoTag(servingConfigIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getServingConfigIdsList().size(); + } + size += unknownFields.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.Model.ServingConfigList)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Model.ServingConfigList other = + (com.google.cloud.retail.v2beta.Model.ServingConfigList) obj; + + if (!getServingConfigIdsList().equals(other.getServingConfigIdsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getServingConfigIdsCount() > 0) { + hash = (37 * hash) + SERVING_CONFIG_IDS_FIELD_NUMBER; + hash = (53 * hash) + getServingConfigIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Model.ServingConfigList parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Model.ServingConfigList 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.Model.ServingConfigList parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Model.ServingConfigList 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.Model.ServingConfigList parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Model.ServingConfigList 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.Model.ServingConfigList parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Model.ServingConfigList 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.Model.ServingConfigList parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Model.ServingConfigList 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.Model.ServingConfigList 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.Model.ServingConfigList 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.Model.ServingConfigList 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; + } + /** + * + * + *
+     * Represents an ordered combination of valid serving configs, which
+     * can be used for `PAGE_OPTIMIZATION` recommendations.
+     * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Model.ServingConfigList} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Model.ServingConfigList) + com.google.cloud.retail.v2beta.Model.ServingConfigListOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelProto + .internal_static_google_cloud_retail_v2beta_Model_ServingConfigList_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelProto + .internal_static_google_cloud_retail_v2beta_Model_ServingConfigList_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Model.ServingConfigList.class, + com.google.cloud.retail.v2beta.Model.ServingConfigList.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Model.ServingConfigList.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + servingConfigIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelProto + .internal_static_google_cloud_retail_v2beta_Model_ServingConfigList_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.ServingConfigList getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Model.ServingConfigList.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.ServingConfigList build() { + com.google.cloud.retail.v2beta.Model.ServingConfigList result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.ServingConfigList buildPartial() { + com.google.cloud.retail.v2beta.Model.ServingConfigList result = + new com.google.cloud.retail.v2beta.Model.ServingConfigList(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + servingConfigIds_ = servingConfigIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.servingConfigIds_ = servingConfigIds_; + onBuilt(); + return result; + } + + @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.Model.ServingConfigList) { + return mergeFrom((com.google.cloud.retail.v2beta.Model.ServingConfigList) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Model.ServingConfigList other) { + if (other == com.google.cloud.retail.v2beta.Model.ServingConfigList.getDefaultInstance()) + return this; + if (!other.servingConfigIds_.isEmpty()) { + if (servingConfigIds_.isEmpty()) { + servingConfigIds_ = other.servingConfigIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServingConfigIdsIsMutable(); + servingConfigIds_.addAll(other.servingConfigIds_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.Model.ServingConfigList parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.Model.ServingConfigList) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList servingConfigIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureServingConfigIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + servingConfigIds_ = new com.google.protobuf.LazyStringArrayList(servingConfigIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Optional. A set of valid serving configs that may be used for
+       * `PAGE_OPTIMIZATION`.
+       * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return A list containing the servingConfigIds. + */ + public com.google.protobuf.ProtocolStringList getServingConfigIdsList() { + return servingConfigIds_.getUnmodifiableView(); + } + /** + * + * + *
+       * Optional. A set of valid serving configs that may be used for
+       * `PAGE_OPTIMIZATION`.
+       * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The count of servingConfigIds. + */ + public int getServingConfigIdsCount() { + return servingConfigIds_.size(); + } + /** + * + * + *
+       * Optional. A set of valid serving configs that may be used for
+       * `PAGE_OPTIMIZATION`.
+       * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the element to return. + * @return The servingConfigIds at the given index. + */ + public java.lang.String getServingConfigIds(int index) { + return servingConfigIds_.get(index); + } + /** + * + * + *
+       * Optional. A set of valid serving configs that may be used for
+       * `PAGE_OPTIMIZATION`.
+       * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index of the value to return. + * @return The bytes of the servingConfigIds at the given index. + */ + public com.google.protobuf.ByteString getServingConfigIdsBytes(int index) { + return servingConfigIds_.getByteString(index); + } + /** + * + * + *
+       * Optional. A set of valid serving configs that may be used for
+       * `PAGE_OPTIMIZATION`.
+       * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param index The index to set the value at. + * @param value The servingConfigIds to set. + * @return This builder for chaining. + */ + public Builder setServingConfigIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureServingConfigIdsIsMutable(); + servingConfigIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. A set of valid serving configs that may be used for
+       * `PAGE_OPTIMIZATION`.
+       * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The servingConfigIds to add. + * @return This builder for chaining. + */ + public Builder addServingConfigIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureServingConfigIdsIsMutable(); + servingConfigIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. A set of valid serving configs that may be used for
+       * `PAGE_OPTIMIZATION`.
+       * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param values The servingConfigIds to add. + * @return This builder for chaining. + */ + public Builder addAllServingConfigIds(java.lang.Iterable values) { + ensureServingConfigIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, servingConfigIds_); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. A set of valid serving configs that may be used for
+       * `PAGE_OPTIMIZATION`.
+       * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearServingConfigIds() { + servingConfigIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. A set of valid serving configs that may be used for
+       * `PAGE_OPTIMIZATION`.
+       * 
+ * + * repeated string serving_config_ids = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes of the servingConfigIds to add. + * @return This builder for chaining. + */ + public Builder addServingConfigIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureServingConfigIdsIsMutable(); + servingConfigIds_.add(value); + 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.Model.ServingConfigList) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Model.ServingConfigList) + private static final com.google.cloud.retail.v2beta.Model.ServingConfigList DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Model.ServingConfigList(); + } + + public static com.google.cloud.retail.v2beta.Model.ServingConfigList getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ServingConfigList parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServingConfigList(input, extensionRegistry); + } + }; + + 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.Model.ServingConfigList getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The fully qualified resource name of the model.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * catalog_id has char limit of 50.
+   * recommendation_model_id has char limit of 40.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The fully qualified resource name of the model.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * catalog_id has char limit of 50.
+   * recommendation_model_id has char limit of 40.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The display name of the model.
+   * Should be human readable, used to display Recommendation Models in the
+   * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024
+   * characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The display name of the model.
+   * Should be human readable, used to display Recommendation Models in the
+   * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024
+   * characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRAINING_STATE_FIELD_NUMBER = 3; + private int trainingState_; + /** + * + * + *
+   * Optional. The training state that the model is in (e.g.
+   * `TRAINING` or `PAUSED`).
+   * Since part of the cost of running the service
+   * is frequency of training - this can be used to determine when to train
+   * model in order to control cost. If not specified: the default value for
+   * `CreateModel` method is `TRAINING`. The default value for
+   * `UpdateModel` method is to keep the state the same as before.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for trainingState. + */ + @java.lang.Override + public int getTrainingStateValue() { + return trainingState_; + } + /** + * + * + *
+   * Optional. The training state that the model is in (e.g.
+   * `TRAINING` or `PAUSED`).
+   * Since part of the cost of running the service
+   * is frequency of training - this can be used to determine when to train
+   * model in order to control cost. If not specified: the default value for
+   * `CreateModel` method is `TRAINING`. The default value for
+   * `UpdateModel` method is to keep the state the same as before.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The trainingState. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.TrainingState getTrainingState() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Model.TrainingState result = + com.google.cloud.retail.v2beta.Model.TrainingState.valueOf(trainingState_); + return result == null + ? com.google.cloud.retail.v2beta.Model.TrainingState.UNRECOGNIZED + : result; + } + + public static final int SERVING_STATE_FIELD_NUMBER = 4; + private int servingState_; + /** + * + * + *
+   * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for servingState. + */ + @java.lang.Override + public int getServingStateValue() { + return servingState_; + } + /** + * + * + *
+   * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The servingState. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.ServingState getServingState() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Model.ServingState result = + com.google.cloud.retail.v2beta.Model.ServingState.valueOf(servingState_); + return result == null ? com.google.cloud.retail.v2beta.Model.ServingState.UNRECOGNIZED : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was created at.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was created at.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was created at.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was last updated. E.g.
+   * if a Recommendation Model was paused - this would be the time the pause was
+   * initiated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was last updated. E.g.
+   * if a Recommendation Model was paused - this would be the time the pause was
+   * initiated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was last updated. E.g.
+   * if a Recommendation Model was paused - this would be the time the pause was
+   * initiated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int TYPE_FIELD_NUMBER = 7; + private volatile java.lang.Object type_; + /** + * + * + *
+   * Required. The type of model e.g. `home-page`.
+   * Currently supported values: `recommended-for-you`, `others-you-may-like`,
+   * `frequently-bought-together`, `page-optimization`, `similar-items`,
+   * `buy-it-again`, and `recently-viewed`(readonly value).
+   * This field together with
+   * [optimization_objective][google.cloud.retail.v2beta.Model.optimization_objective]
+   * describe model metadata to use to control model training and serving.
+   * See https://cloud.google.com/retail/docs/models
+   * for more details on what the model metadata control and which combination
+   * of parameters are valid. For invalid combinations of parameters (e.g. type
+   * = `frequently-bought-together` and optimization_objective = `ctr`), you
+   * receive an error 400 if you try to create/update a recommendation with
+   * this set of knobs.
+   * 
+ * + * string type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The type of model e.g. `home-page`.
+   * Currently supported values: `recommended-for-you`, `others-you-may-like`,
+   * `frequently-bought-together`, `page-optimization`, `similar-items`,
+   * `buy-it-again`, and `recently-viewed`(readonly value).
+   * This field together with
+   * [optimization_objective][google.cloud.retail.v2beta.Model.optimization_objective]
+   * describe model metadata to use to control model training and serving.
+   * See https://cloud.google.com/retail/docs/models
+   * for more details on what the model metadata control and which combination
+   * of parameters are valid. For invalid combinations of parameters (e.g. type
+   * = `frequently-bought-together` and optimization_objective = `ctr`), you
+   * receive an error 400 if you try to create/update a recommendation with
+   * this set of knobs.
+   * 
+ * + * string type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPTIMIZATION_OBJECTIVE_FIELD_NUMBER = 8; + private volatile java.lang.Object optimizationObjective_; + /** + * + * + *
+   * Optional. The optimization objective e.g. `cvr`.
+   * Currently supported
+   * values: `ctr`, `cvr`, `revenue-per-order`.
+   *  If not specified, we choose default based on model type.
+   * Default depends on type of recommendation:
+   * `recommended-for-you` => `ctr`
+   * `others-you-may-like` => `ctr`
+   * `frequently-bought-together` => `revenue_per_order`
+   * This field together with
+   * [optimization_objective][google.cloud.retail.v2beta.Model.type]
+   * describe model metadata to use to control model training and serving.
+   * See https://cloud.google.com/retail/docs/models
+   * for more details on what the model metadata control and which combination
+   * of parameters are valid. For invalid combinations of parameters (e.g. type
+   * = `frequently-bought-together` and optimization_objective = `ctr`), you
+   * receive an error 400 if you try to create/update a recommendation with
+   * this set of knobs.
+   * 
+ * + * string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The optimizationObjective. + */ + @java.lang.Override + public java.lang.String getOptimizationObjective() { + java.lang.Object ref = optimizationObjective_; + 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(); + optimizationObjective_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The optimization objective e.g. `cvr`.
+   * Currently supported
+   * values: `ctr`, `cvr`, `revenue-per-order`.
+   *  If not specified, we choose default based on model type.
+   * Default depends on type of recommendation:
+   * `recommended-for-you` => `ctr`
+   * `others-you-may-like` => `ctr`
+   * `frequently-bought-together` => `revenue_per_order`
+   * This field together with
+   * [optimization_objective][google.cloud.retail.v2beta.Model.type]
+   * describe model metadata to use to control model training and serving.
+   * See https://cloud.google.com/retail/docs/models
+   * for more details on what the model metadata control and which combination
+   * of parameters are valid. For invalid combinations of parameters (e.g. type
+   * = `frequently-bought-together` and optimization_objective = `ctr`), you
+   * receive an error 400 if you try to create/update a recommendation with
+   * this set of knobs.
+   * 
+ * + * string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for optimizationObjective. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOptimizationObjectiveBytes() { + java.lang.Object ref = optimizationObjective_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + optimizationObjective_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PERIODIC_TUNING_STATE_FIELD_NUMBER = 11; + private int periodicTuningState_; + /** + * + * + *
+   * Optional. The state of periodic tuning.
+   * The period we use is 3 months - to do a
+   * one-off tune earlier use the `TuneModel` method. Default value
+   * is `PERIODIC_TUNING_ENABLED`.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for periodicTuningState. + */ + @java.lang.Override + public int getPeriodicTuningStateValue() { + return periodicTuningState_; + } + /** + * + * + *
+   * Optional. The state of periodic tuning.
+   * The period we use is 3 months - to do a
+   * one-off tune earlier use the `TuneModel` method. Default value
+   * is `PERIODIC_TUNING_ENABLED`.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The periodicTuningState. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.PeriodicTuningState getPeriodicTuningState() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Model.PeriodicTuningState result = + com.google.cloud.retail.v2beta.Model.PeriodicTuningState.valueOf(periodicTuningState_); + return result == null + ? com.google.cloud.retail.v2beta.Model.PeriodicTuningState.UNRECOGNIZED + : result; + } + + public static final int LAST_TUNE_TIME_FIELD_NUMBER = 12; + private com.google.protobuf.Timestamp lastTuneTime_; + /** + * + * + *
+   * Output only. The timestamp when the latest successful tune finished.
+   * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the lastTuneTime field is set. + */ + @java.lang.Override + public boolean hasLastTuneTime() { + return lastTuneTime_ != null; + } + /** + * + * + *
+   * Output only. The timestamp when the latest successful tune finished.
+   * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastTuneTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getLastTuneTime() { + return lastTuneTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : lastTuneTime_; + } + /** + * + * + *
+   * Output only. The timestamp when the latest successful tune finished.
+   * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getLastTuneTimeOrBuilder() { + return getLastTuneTime(); + } + + public static final int TUNING_OPERATION_FIELD_NUMBER = 15; + private volatile java.lang.Object tuningOperation_; + /** + * + * + *
+   * Output only. The tune operation associated with the model.
+   * Can be used to determine if there is an ongoing tune for this
+   * recommendation. Empty field implies no tune is goig on.
+   * 
+ * + * string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The tuningOperation. + */ + @java.lang.Override + public java.lang.String getTuningOperation() { + java.lang.Object ref = tuningOperation_; + 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(); + tuningOperation_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The tune operation associated with the model.
+   * Can be used to determine if there is an ongoing tune for this
+   * recommendation. Empty field implies no tune is goig on.
+   * 
+ * + * string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for tuningOperation. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTuningOperationBytes() { + java.lang.Object ref = tuningOperation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tuningOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_STATE_FIELD_NUMBER = 16; + private int dataState_; + /** + * + * + *
+   * Output only. The state of data requirements for this model: `DATA_OK` and
+   * `DATA_ERROR`.
+   * Recommendation model cannot be trained if the data is in
+   * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even
+   * if serving state is `ACTIVE`: models were trained successfully before, but
+   * cannot be refreshed because model no longer has sufficient
+   * data for training.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for dataState. + */ + @java.lang.Override + public int getDataStateValue() { + return dataState_; + } + /** + * + * + *
+   * Output only. The state of data requirements for this model: `DATA_OK` and
+   * `DATA_ERROR`.
+   * Recommendation model cannot be trained if the data is in
+   * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even
+   * if serving state is `ACTIVE`: models were trained successfully before, but
+   * cannot be refreshed because model no longer has sufficient
+   * data for training.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The dataState. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.DataState getDataState() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Model.DataState result = + com.google.cloud.retail.v2beta.Model.DataState.valueOf(dataState_); + return result == null ? com.google.cloud.retail.v2beta.Model.DataState.UNRECOGNIZED : result; + } + + public static final int FILTERING_OPTION_FIELD_NUMBER = 18; + private int filteringOption_; + /** + * + * + *
+   * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering
+   * by attributes is enabled for the model.
+   * 
+ * + * + * .google.cloud.retail.v2beta.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for filteringOption. + */ + @java.lang.Override + public int getFilteringOptionValue() { + return filteringOption_; + } + /** + * + * + *
+   * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering
+   * by attributes is enabled for the model.
+   * 
+ * + * + * .google.cloud.retail.v2beta.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The filteringOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.RecommendationsFilteringOption getFilteringOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.RecommendationsFilteringOption result = + com.google.cloud.retail.v2beta.RecommendationsFilteringOption.valueOf(filteringOption_); + return result == null + ? com.google.cloud.retail.v2beta.RecommendationsFilteringOption.UNRECOGNIZED + : result; + } + + public static final int SERVING_CONFIG_LISTS_FIELD_NUMBER = 19; + private java.util.List + servingConfigLists_; + /** + * + * + *
+   * Output only. The list of valid serving configs associated with the
+   * PageOptimizationConfig.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getServingConfigListsList() { + return servingConfigLists_; + } + /** + * + * + *
+   * Output only. The list of valid serving configs associated with the
+   * PageOptimizationConfig.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getServingConfigListsOrBuilderList() { + return servingConfigLists_; + } + /** + * + * + *
+   * Output only. The list of valid serving configs associated with the
+   * PageOptimizationConfig.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getServingConfigListsCount() { + return servingConfigLists_.size(); + } + /** + * + * + *
+   * Output only. The list of valid serving configs associated with the
+   * PageOptimizationConfig.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.ServingConfigList getServingConfigLists(int index) { + return servingConfigLists_.get(index); + } + /** + * + * + *
+   * Output only. The list of valid serving configs associated with the
+   * PageOptimizationConfig.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.ServingConfigListOrBuilder + getServingConfigListsOrBuilder(int index) { + return servingConfigLists_.get(index); + } + + 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(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (trainingState_ + != com.google.cloud.retail.v2beta.Model.TrainingState.TRAINING_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, trainingState_); + } + if (servingState_ + != com.google.cloud.retail.v2beta.Model.ServingState.SERVING_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, servingState_); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(6, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(optimizationObjective_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, optimizationObjective_); + } + if (periodicTuningState_ + != com.google.cloud.retail.v2beta.Model.PeriodicTuningState + .PERIODIC_TUNING_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(11, periodicTuningState_); + } + if (lastTuneTime_ != null) { + output.writeMessage(12, getLastTuneTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tuningOperation_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, tuningOperation_); + } + if (dataState_ + != com.google.cloud.retail.v2beta.Model.DataState.DATA_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(16, dataState_); + } + if (filteringOption_ + != com.google.cloud.retail.v2beta.RecommendationsFilteringOption + .RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(18, filteringOption_); + } + for (int i = 0; i < servingConfigLists_.size(); i++) { + output.writeMessage(19, servingConfigLists_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (trainingState_ + != com.google.cloud.retail.v2beta.Model.TrainingState.TRAINING_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, trainingState_); + } + if (servingState_ + != com.google.cloud.retail.v2beta.Model.ServingState.SERVING_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, servingState_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getUpdateTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(optimizationObjective_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, optimizationObjective_); + } + if (periodicTuningState_ + != com.google.cloud.retail.v2beta.Model.PeriodicTuningState + .PERIODIC_TUNING_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, periodicTuningState_); + } + if (lastTuneTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getLastTuneTime()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tuningOperation_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, tuningOperation_); + } + if (dataState_ + != com.google.cloud.retail.v2beta.Model.DataState.DATA_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(16, dataState_); + } + if (filteringOption_ + != com.google.cloud.retail.v2beta.RecommendationsFilteringOption + .RECOMMENDATIONS_FILTERING_OPTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(18, filteringOption_); + } + for (int i = 0; i < servingConfigLists_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(19, servingConfigLists_.get(i)); + } + size += unknownFields.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.Model)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.Model other = (com.google.cloud.retail.v2beta.Model) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (trainingState_ != other.trainingState_) return false; + if (servingState_ != other.servingState_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getType().equals(other.getType())) return false; + if (!getOptimizationObjective().equals(other.getOptimizationObjective())) return false; + if (periodicTuningState_ != other.periodicTuningState_) return false; + if (hasLastTuneTime() != other.hasLastTuneTime()) return false; + if (hasLastTuneTime()) { + if (!getLastTuneTime().equals(other.getLastTuneTime())) return false; + } + if (!getTuningOperation().equals(other.getTuningOperation())) return false; + if (dataState_ != other.dataState_) return false; + if (filteringOption_ != other.filteringOption_) return false; + if (!getServingConfigListsList().equals(other.getServingConfigListsList())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + TRAINING_STATE_FIELD_NUMBER; + hash = (53 * hash) + trainingState_; + hash = (37 * hash) + SERVING_STATE_FIELD_NUMBER; + hash = (53 * hash) + servingState_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + OPTIMIZATION_OBJECTIVE_FIELD_NUMBER; + hash = (53 * hash) + getOptimizationObjective().hashCode(); + hash = (37 * hash) + PERIODIC_TUNING_STATE_FIELD_NUMBER; + hash = (53 * hash) + periodicTuningState_; + if (hasLastTuneTime()) { + hash = (37 * hash) + LAST_TUNE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getLastTuneTime().hashCode(); + } + hash = (37 * hash) + TUNING_OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getTuningOperation().hashCode(); + hash = (37 * hash) + DATA_STATE_FIELD_NUMBER; + hash = (53 * hash) + dataState_; + hash = (37 * hash) + FILTERING_OPTION_FIELD_NUMBER; + hash = (53 * hash) + filteringOption_; + if (getServingConfigListsCount() > 0) { + hash = (37 * hash) + SERVING_CONFIG_LISTS_FIELD_NUMBER; + hash = (53 * hash) + getServingConfigListsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.Model parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Model 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.Model parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Model 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.Model parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.Model 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.Model parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Model 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.Model parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.Model 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.Model 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.Model 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.Model 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; + } + /** + * + * + *
+   * Metadata that describes the training and serving parameters of a
+   * [Model][google.cloud.retail.v2beta.Model]. A
+   * [Model][google.cloud.retail.v2beta.Model] can be associated with a
+   * [ServingConfig][google.cloud.retail.v2beta.ServingConfig] and then queried
+   * through the Predict API.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.Model} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.Model) + com.google.cloud.retail.v2beta.ModelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelProto + .internal_static_google_cloud_retail_v2beta_Model_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelProto + .internal_static_google_cloud_retail_v2beta_Model_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.Model.class, + com.google.cloud.retail.v2beta.Model.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.Model.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getServingConfigListsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + trainingState_ = 0; + + servingState_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + type_ = ""; + + optimizationObjective_ = ""; + + periodicTuningState_ = 0; + + if (lastTuneTimeBuilder_ == null) { + lastTuneTime_ = null; + } else { + lastTuneTime_ = null; + lastTuneTimeBuilder_ = null; + } + tuningOperation_ = ""; + + dataState_ = 0; + + filteringOption_ = 0; + + if (servingConfigListsBuilder_ == null) { + servingConfigLists_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + servingConfigListsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelProto + .internal_static_google_cloud_retail_v2beta_Model_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Model getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.Model.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Model build() { + com.google.cloud.retail.v2beta.Model result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.Model buildPartial() { + com.google.cloud.retail.v2beta.Model result = new com.google.cloud.retail.v2beta.Model(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + result.trainingState_ = trainingState_; + result.servingState_ = servingState_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.type_ = type_; + result.optimizationObjective_ = optimizationObjective_; + result.periodicTuningState_ = periodicTuningState_; + if (lastTuneTimeBuilder_ == null) { + result.lastTuneTime_ = lastTuneTime_; + } else { + result.lastTuneTime_ = lastTuneTimeBuilder_.build(); + } + result.tuningOperation_ = tuningOperation_; + result.dataState_ = dataState_; + result.filteringOption_ = filteringOption_; + if (servingConfigListsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + servingConfigLists_ = java.util.Collections.unmodifiableList(servingConfigLists_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.servingConfigLists_ = servingConfigLists_; + } else { + result.servingConfigLists_ = servingConfigListsBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.Model) { + return mergeFrom((com.google.cloud.retail.v2beta.Model) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.Model other) { + if (other == com.google.cloud.retail.v2beta.Model.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.trainingState_ != 0) { + setTrainingStateValue(other.getTrainingStateValue()); + } + if (other.servingState_ != 0) { + setServingStateValue(other.getServingStateValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getOptimizationObjective().isEmpty()) { + optimizationObjective_ = other.optimizationObjective_; + onChanged(); + } + if (other.periodicTuningState_ != 0) { + setPeriodicTuningStateValue(other.getPeriodicTuningStateValue()); + } + if (other.hasLastTuneTime()) { + mergeLastTuneTime(other.getLastTuneTime()); + } + if (!other.getTuningOperation().isEmpty()) { + tuningOperation_ = other.tuningOperation_; + onChanged(); + } + if (other.dataState_ != 0) { + setDataStateValue(other.getDataStateValue()); + } + if (other.filteringOption_ != 0) { + setFilteringOptionValue(other.getFilteringOptionValue()); + } + if (servingConfigListsBuilder_ == null) { + if (!other.servingConfigLists_.isEmpty()) { + if (servingConfigLists_.isEmpty()) { + servingConfigLists_ = other.servingConfigLists_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureServingConfigListsIsMutable(); + servingConfigLists_.addAll(other.servingConfigLists_); + } + onChanged(); + } + } else { + if (!other.servingConfigLists_.isEmpty()) { + if (servingConfigListsBuilder_.isEmpty()) { + servingConfigListsBuilder_.dispose(); + servingConfigListsBuilder_ = null; + servingConfigLists_ = other.servingConfigLists_; + bitField0_ = (bitField0_ & ~0x00000001); + servingConfigListsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getServingConfigListsFieldBuilder() + : null; + } else { + servingConfigListsBuilder_.addAllMessages(other.servingConfigLists_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.Model parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.Model) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The fully qualified resource name of the model.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * catalog_id has char limit of 50.
+     * recommendation_model_id has char limit of 40.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The fully qualified resource name of the model.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * catalog_id has char limit of 50.
+     * recommendation_model_id has char limit of 40.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The fully qualified resource name of the model.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * catalog_id has char limit of 50.
+     * recommendation_model_id has char limit of 40.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The fully qualified resource name of the model.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * catalog_id has char limit of 50.
+     * recommendation_model_id has char limit of 40.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The fully qualified resource name of the model.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * catalog_id has char limit of 50.
+     * recommendation_model_id has char limit of 40.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The display name of the model.
+     * Should be human readable, used to display Recommendation Models in the
+     * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024
+     * characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The display name of the model.
+     * Should be human readable, used to display Recommendation Models in the
+     * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024
+     * characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The display name of the model.
+     * Should be human readable, used to display Recommendation Models in the
+     * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024
+     * characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the model.
+     * Should be human readable, used to display Recommendation Models in the
+     * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024
+     * characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The display name of the model.
+     * Should be human readable, used to display Recommendation Models in the
+     * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024
+     * characters.
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private int trainingState_ = 0; + /** + * + * + *
+     * Optional. The training state that the model is in (e.g.
+     * `TRAINING` or `PAUSED`).
+     * Since part of the cost of running the service
+     * is frequency of training - this can be used to determine when to train
+     * model in order to control cost. If not specified: the default value for
+     * `CreateModel` method is `TRAINING`. The default value for
+     * `UpdateModel` method is to keep the state the same as before.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for trainingState. + */ + @java.lang.Override + public int getTrainingStateValue() { + return trainingState_; + } + /** + * + * + *
+     * Optional. The training state that the model is in (e.g.
+     * `TRAINING` or `PAUSED`).
+     * Since part of the cost of running the service
+     * is frequency of training - this can be used to determine when to train
+     * model in order to control cost. If not specified: the default value for
+     * `CreateModel` method is `TRAINING`. The default value for
+     * `UpdateModel` method is to keep the state the same as before.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for trainingState to set. + * @return This builder for chaining. + */ + public Builder setTrainingStateValue(int value) { + + trainingState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The training state that the model is in (e.g.
+     * `TRAINING` or `PAUSED`).
+     * Since part of the cost of running the service
+     * is frequency of training - this can be used to determine when to train
+     * model in order to control cost. If not specified: the default value for
+     * `CreateModel` method is `TRAINING`. The default value for
+     * `UpdateModel` method is to keep the state the same as before.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The trainingState. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.TrainingState getTrainingState() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Model.TrainingState result = + com.google.cloud.retail.v2beta.Model.TrainingState.valueOf(trainingState_); + return result == null + ? com.google.cloud.retail.v2beta.Model.TrainingState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. The training state that the model is in (e.g.
+     * `TRAINING` or `PAUSED`).
+     * Since part of the cost of running the service
+     * is frequency of training - this can be used to determine when to train
+     * model in order to control cost. If not specified: the default value for
+     * `CreateModel` method is `TRAINING`. The default value for
+     * `UpdateModel` method is to keep the state the same as before.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The trainingState to set. + * @return This builder for chaining. + */ + public Builder setTrainingState(com.google.cloud.retail.v2beta.Model.TrainingState value) { + if (value == null) { + throw new NullPointerException(); + } + + trainingState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The training state that the model is in (e.g.
+     * `TRAINING` or `PAUSED`).
+     * Since part of the cost of running the service
+     * is frequency of training - this can be used to determine when to train
+     * model in order to control cost. If not specified: the default value for
+     * `CreateModel` method is `TRAINING`. The default value for
+     * `UpdateModel` method is to keep the state the same as before.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTrainingState() { + + trainingState_ = 0; + onChanged(); + return this; + } + + private int servingState_ = 0; + /** + * + * + *
+     * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for servingState. + */ + @java.lang.Override + public int getServingStateValue() { + return servingState_; + } + /** + * + * + *
+     * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for servingState to set. + * @return This builder for chaining. + */ + public Builder setServingStateValue(int value) { + + servingState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The servingState. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.ServingState getServingState() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Model.ServingState result = + com.google.cloud.retail.v2beta.Model.ServingState.valueOf(servingState_); + return result == null + ? com.google.cloud.retail.v2beta.Model.ServingState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The servingState to set. + * @return This builder for chaining. + */ + public Builder setServingState(com.google.cloud.retail.v2beta.Model.ServingState value) { + if (value == null) { + throw new NullPointerException(); + } + + servingState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearServingState() { + + servingState_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was created at.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was created at.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was created at.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was created at.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was created at.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was created at.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was created at.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was created at.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was created at.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was last updated. E.g.
+     * if a Recommendation Model was paused - this would be the time the pause was
+     * initiated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was last updated. E.g.
+     * if a Recommendation Model was paused - this would be the time the pause was
+     * initiated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was last updated. E.g.
+     * if a Recommendation Model was paused - this would be the time the pause was
+     * initiated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was last updated. E.g.
+     * if a Recommendation Model was paused - this would be the time the pause was
+     * initiated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was last updated. E.g.
+     * if a Recommendation Model was paused - this would be the time the pause was
+     * initiated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was last updated. E.g.
+     * if a Recommendation Model was paused - this would be the time the pause was
+     * initiated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was last updated. E.g.
+     * if a Recommendation Model was paused - this would be the time the pause was
+     * initiated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was last updated. E.g.
+     * if a Recommendation Model was paused - this would be the time the pause was
+     * initiated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp the Recommendation Model was last updated. E.g.
+     * if a Recommendation Model was paused - this would be the time the pause was
+     * initiated.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * Required. The type of model e.g. `home-page`.
+     * Currently supported values: `recommended-for-you`, `others-you-may-like`,
+     * `frequently-bought-together`, `page-optimization`, `similar-items`,
+     * `buy-it-again`, and `recently-viewed`(readonly value).
+     * This field together with
+     * [optimization_objective][google.cloud.retail.v2beta.Model.optimization_objective]
+     * describe model metadata to use to control model training and serving.
+     * See https://cloud.google.com/retail/docs/models
+     * for more details on what the model metadata control and which combination
+     * of parameters are valid. For invalid combinations of parameters (e.g. type
+     * = `frequently-bought-together` and optimization_objective = `ctr`), you
+     * receive an error 400 if you try to create/update a recommendation with
+     * this set of knobs.
+     * 
+ * + * string type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The type of model e.g. `home-page`.
+     * Currently supported values: `recommended-for-you`, `others-you-may-like`,
+     * `frequently-bought-together`, `page-optimization`, `similar-items`,
+     * `buy-it-again`, and `recently-viewed`(readonly value).
+     * This field together with
+     * [optimization_objective][google.cloud.retail.v2beta.Model.optimization_objective]
+     * describe model metadata to use to control model training and serving.
+     * See https://cloud.google.com/retail/docs/models
+     * for more details on what the model metadata control and which combination
+     * of parameters are valid. For invalid combinations of parameters (e.g. type
+     * = `frequently-bought-together` and optimization_objective = `ctr`), you
+     * receive an error 400 if you try to create/update a recommendation with
+     * this set of knobs.
+     * 
+ * + * string type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The type of model e.g. `home-page`.
+     * Currently supported values: `recommended-for-you`, `others-you-may-like`,
+     * `frequently-bought-together`, `page-optimization`, `similar-items`,
+     * `buy-it-again`, and `recently-viewed`(readonly value).
+     * This field together with
+     * [optimization_objective][google.cloud.retail.v2beta.Model.optimization_objective]
+     * describe model metadata to use to control model training and serving.
+     * See https://cloud.google.com/retail/docs/models
+     * for more details on what the model metadata control and which combination
+     * of parameters are valid. For invalid combinations of parameters (e.g. type
+     * = `frequently-bought-together` and optimization_objective = `ctr`), you
+     * receive an error 400 if you try to create/update a recommendation with
+     * this set of knobs.
+     * 
+ * + * string type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of model e.g. `home-page`.
+     * Currently supported values: `recommended-for-you`, `others-you-may-like`,
+     * `frequently-bought-together`, `page-optimization`, `similar-items`,
+     * `buy-it-again`, and `recently-viewed`(readonly value).
+     * This field together with
+     * [optimization_objective][google.cloud.retail.v2beta.Model.optimization_objective]
+     * describe model metadata to use to control model training and serving.
+     * See https://cloud.google.com/retail/docs/models
+     * for more details on what the model metadata control and which combination
+     * of parameters are valid. For invalid combinations of parameters (e.g. type
+     * = `frequently-bought-together` and optimization_objective = `ctr`), you
+     * receive an error 400 if you try to create/update a recommendation with
+     * this set of knobs.
+     * 
+ * + * string type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The type of model e.g. `home-page`.
+     * Currently supported values: `recommended-for-you`, `others-you-may-like`,
+     * `frequently-bought-together`, `page-optimization`, `similar-items`,
+     * `buy-it-again`, and `recently-viewed`(readonly value).
+     * This field together with
+     * [optimization_objective][google.cloud.retail.v2beta.Model.optimization_objective]
+     * describe model metadata to use to control model training and serving.
+     * See https://cloud.google.com/retail/docs/models
+     * for more details on what the model metadata control and which combination
+     * of parameters are valid. For invalid combinations of parameters (e.g. type
+     * = `frequently-bought-together` and optimization_objective = `ctr`), you
+     * receive an error 400 if you try to create/update a recommendation with
+     * this set of knobs.
+     * 
+ * + * string type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object optimizationObjective_ = ""; + /** + * + * + *
+     * Optional. The optimization objective e.g. `cvr`.
+     * Currently supported
+     * values: `ctr`, `cvr`, `revenue-per-order`.
+     *  If not specified, we choose default based on model type.
+     * Default depends on type of recommendation:
+     * `recommended-for-you` => `ctr`
+     * `others-you-may-like` => `ctr`
+     * `frequently-bought-together` => `revenue_per_order`
+     * This field together with
+     * [optimization_objective][google.cloud.retail.v2beta.Model.type]
+     * describe model metadata to use to control model training and serving.
+     * See https://cloud.google.com/retail/docs/models
+     * for more details on what the model metadata control and which combination
+     * of parameters are valid. For invalid combinations of parameters (e.g. type
+     * = `frequently-bought-together` and optimization_objective = `ctr`), you
+     * receive an error 400 if you try to create/update a recommendation with
+     * this set of knobs.
+     * 
+ * + * string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The optimizationObjective. + */ + public java.lang.String getOptimizationObjective() { + java.lang.Object ref = optimizationObjective_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + optimizationObjective_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The optimization objective e.g. `cvr`.
+     * Currently supported
+     * values: `ctr`, `cvr`, `revenue-per-order`.
+     *  If not specified, we choose default based on model type.
+     * Default depends on type of recommendation:
+     * `recommended-for-you` => `ctr`
+     * `others-you-may-like` => `ctr`
+     * `frequently-bought-together` => `revenue_per_order`
+     * This field together with
+     * [optimization_objective][google.cloud.retail.v2beta.Model.type]
+     * describe model metadata to use to control model training and serving.
+     * See https://cloud.google.com/retail/docs/models
+     * for more details on what the model metadata control and which combination
+     * of parameters are valid. For invalid combinations of parameters (e.g. type
+     * = `frequently-bought-together` and optimization_objective = `ctr`), you
+     * receive an error 400 if you try to create/update a recommendation with
+     * this set of knobs.
+     * 
+ * + * string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for optimizationObjective. + */ + public com.google.protobuf.ByteString getOptimizationObjectiveBytes() { + java.lang.Object ref = optimizationObjective_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + optimizationObjective_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The optimization objective e.g. `cvr`.
+     * Currently supported
+     * values: `ctr`, `cvr`, `revenue-per-order`.
+     *  If not specified, we choose default based on model type.
+     * Default depends on type of recommendation:
+     * `recommended-for-you` => `ctr`
+     * `others-you-may-like` => `ctr`
+     * `frequently-bought-together` => `revenue_per_order`
+     * This field together with
+     * [optimization_objective][google.cloud.retail.v2beta.Model.type]
+     * describe model metadata to use to control model training and serving.
+     * See https://cloud.google.com/retail/docs/models
+     * for more details on what the model metadata control and which combination
+     * of parameters are valid. For invalid combinations of parameters (e.g. type
+     * = `frequently-bought-together` and optimization_objective = `ctr`), you
+     * receive an error 400 if you try to create/update a recommendation with
+     * this set of knobs.
+     * 
+ * + * string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The optimizationObjective to set. + * @return This builder for chaining. + */ + public Builder setOptimizationObjective(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + optimizationObjective_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The optimization objective e.g. `cvr`.
+     * Currently supported
+     * values: `ctr`, `cvr`, `revenue-per-order`.
+     *  If not specified, we choose default based on model type.
+     * Default depends on type of recommendation:
+     * `recommended-for-you` => `ctr`
+     * `others-you-may-like` => `ctr`
+     * `frequently-bought-together` => `revenue_per_order`
+     * This field together with
+     * [optimization_objective][google.cloud.retail.v2beta.Model.type]
+     * describe model metadata to use to control model training and serving.
+     * See https://cloud.google.com/retail/docs/models
+     * for more details on what the model metadata control and which combination
+     * of parameters are valid. For invalid combinations of parameters (e.g. type
+     * = `frequently-bought-together` and optimization_objective = `ctr`), you
+     * receive an error 400 if you try to create/update a recommendation with
+     * this set of knobs.
+     * 
+ * + * string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOptimizationObjective() { + + optimizationObjective_ = getDefaultInstance().getOptimizationObjective(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The optimization objective e.g. `cvr`.
+     * Currently supported
+     * values: `ctr`, `cvr`, `revenue-per-order`.
+     *  If not specified, we choose default based on model type.
+     * Default depends on type of recommendation:
+     * `recommended-for-you` => `ctr`
+     * `others-you-may-like` => `ctr`
+     * `frequently-bought-together` => `revenue_per_order`
+     * This field together with
+     * [optimization_objective][google.cloud.retail.v2beta.Model.type]
+     * describe model metadata to use to control model training and serving.
+     * See https://cloud.google.com/retail/docs/models
+     * for more details on what the model metadata control and which combination
+     * of parameters are valid. For invalid combinations of parameters (e.g. type
+     * = `frequently-bought-together` and optimization_objective = `ctr`), you
+     * receive an error 400 if you try to create/update a recommendation with
+     * this set of knobs.
+     * 
+ * + * string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for optimizationObjective to set. + * @return This builder for chaining. + */ + public Builder setOptimizationObjectiveBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + optimizationObjective_ = value; + onChanged(); + return this; + } + + private int periodicTuningState_ = 0; + /** + * + * + *
+     * Optional. The state of periodic tuning.
+     * The period we use is 3 months - to do a
+     * one-off tune earlier use the `TuneModel` method. Default value
+     * is `PERIODIC_TUNING_ENABLED`.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for periodicTuningState. + */ + @java.lang.Override + public int getPeriodicTuningStateValue() { + return periodicTuningState_; + } + /** + * + * + *
+     * Optional. The state of periodic tuning.
+     * The period we use is 3 months - to do a
+     * one-off tune earlier use the `TuneModel` method. Default value
+     * is `PERIODIC_TUNING_ENABLED`.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for periodicTuningState to set. + * @return This builder for chaining. + */ + public Builder setPeriodicTuningStateValue(int value) { + + periodicTuningState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The state of periodic tuning.
+     * The period we use is 3 months - to do a
+     * one-off tune earlier use the `TuneModel` method. Default value
+     * is `PERIODIC_TUNING_ENABLED`.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The periodicTuningState. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.PeriodicTuningState getPeriodicTuningState() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Model.PeriodicTuningState result = + com.google.cloud.retail.v2beta.Model.PeriodicTuningState.valueOf(periodicTuningState_); + return result == null + ? com.google.cloud.retail.v2beta.Model.PeriodicTuningState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. The state of periodic tuning.
+     * The period we use is 3 months - to do a
+     * one-off tune earlier use the `TuneModel` method. Default value
+     * is `PERIODIC_TUNING_ENABLED`.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The periodicTuningState to set. + * @return This builder for chaining. + */ + public Builder setPeriodicTuningState( + com.google.cloud.retail.v2beta.Model.PeriodicTuningState value) { + if (value == null) { + throw new NullPointerException(); + } + + periodicTuningState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The state of periodic tuning.
+     * The period we use is 3 months - to do a
+     * one-off tune earlier use the `TuneModel` method. Default value
+     * is `PERIODIC_TUNING_ENABLED`.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPeriodicTuningState() { + + periodicTuningState_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp lastTuneTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + lastTuneTimeBuilder_; + /** + * + * + *
+     * Output only. The timestamp when the latest successful tune finished.
+     * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the lastTuneTime field is set. + */ + public boolean hasLastTuneTime() { + return lastTuneTimeBuilder_ != null || lastTuneTime_ != null; + } + /** + * + * + *
+     * Output only. The timestamp when the latest successful tune finished.
+     * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastTuneTime. + */ + public com.google.protobuf.Timestamp getLastTuneTime() { + if (lastTuneTimeBuilder_ == null) { + return lastTuneTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : lastTuneTime_; + } else { + return lastTuneTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The timestamp when the latest successful tune finished.
+     * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setLastTuneTime(com.google.protobuf.Timestamp value) { + if (lastTuneTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lastTuneTime_ = value; + onChanged(); + } else { + lastTuneTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp when the latest successful tune finished.
+     * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setLastTuneTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (lastTuneTimeBuilder_ == null) { + lastTuneTime_ = builderForValue.build(); + onChanged(); + } else { + lastTuneTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp when the latest successful tune finished.
+     * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeLastTuneTime(com.google.protobuf.Timestamp value) { + if (lastTuneTimeBuilder_ == null) { + if (lastTuneTime_ != null) { + lastTuneTime_ = + com.google.protobuf.Timestamp.newBuilder(lastTuneTime_) + .mergeFrom(value) + .buildPartial(); + } else { + lastTuneTime_ = value; + } + onChanged(); + } else { + lastTuneTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp when the latest successful tune finished.
+     * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearLastTuneTime() { + if (lastTuneTimeBuilder_ == null) { + lastTuneTime_ = null; + onChanged(); + } else { + lastTuneTime_ = null; + lastTuneTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp when the latest successful tune finished.
+     * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getLastTuneTimeBuilder() { + + onChanged(); + return getLastTuneTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp when the latest successful tune finished.
+     * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getLastTuneTimeOrBuilder() { + if (lastTuneTimeBuilder_ != null) { + return lastTuneTimeBuilder_.getMessageOrBuilder(); + } else { + return lastTuneTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : lastTuneTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp when the latest successful tune finished.
+     * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getLastTuneTimeFieldBuilder() { + if (lastTuneTimeBuilder_ == null) { + lastTuneTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getLastTuneTime(), getParentForChildren(), isClean()); + lastTuneTime_ = null; + } + return lastTuneTimeBuilder_; + } + + private java.lang.Object tuningOperation_ = ""; + /** + * + * + *
+     * Output only. The tune operation associated with the model.
+     * Can be used to determine if there is an ongoing tune for this
+     * recommendation. Empty field implies no tune is goig on.
+     * 
+ * + * string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The tuningOperation. + */ + public java.lang.String getTuningOperation() { + java.lang.Object ref = tuningOperation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + tuningOperation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The tune operation associated with the model.
+     * Can be used to determine if there is an ongoing tune for this
+     * recommendation. Empty field implies no tune is goig on.
+     * 
+ * + * string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for tuningOperation. + */ + public com.google.protobuf.ByteString getTuningOperationBytes() { + java.lang.Object ref = tuningOperation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + tuningOperation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The tune operation associated with the model.
+     * Can be used to determine if there is an ongoing tune for this
+     * recommendation. Empty field implies no tune is goig on.
+     * 
+ * + * string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The tuningOperation to set. + * @return This builder for chaining. + */ + public Builder setTuningOperation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + tuningOperation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The tune operation associated with the model.
+     * Can be used to determine if there is an ongoing tune for this
+     * recommendation. Empty field implies no tune is goig on.
+     * 
+ * + * string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearTuningOperation() { + + tuningOperation_ = getDefaultInstance().getTuningOperation(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The tune operation associated with the model.
+     * Can be used to determine if there is an ongoing tune for this
+     * recommendation. Empty field implies no tune is goig on.
+     * 
+ * + * string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for tuningOperation to set. + * @return This builder for chaining. + */ + public Builder setTuningOperationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + tuningOperation_ = value; + onChanged(); + return this; + } + + private int dataState_ = 0; + /** + * + * + *
+     * Output only. The state of data requirements for this model: `DATA_OK` and
+     * `DATA_ERROR`.
+     * Recommendation model cannot be trained if the data is in
+     * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even
+     * if serving state is `ACTIVE`: models were trained successfully before, but
+     * cannot be refreshed because model no longer has sufficient
+     * data for training.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for dataState. + */ + @java.lang.Override + public int getDataStateValue() { + return dataState_; + } + /** + * + * + *
+     * Output only. The state of data requirements for this model: `DATA_OK` and
+     * `DATA_ERROR`.
+     * Recommendation model cannot be trained if the data is in
+     * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even
+     * if serving state is `ACTIVE`: models were trained successfully before, but
+     * cannot be refreshed because model no longer has sufficient
+     * data for training.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for dataState to set. + * @return This builder for chaining. + */ + public Builder setDataStateValue(int value) { + + dataState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The state of data requirements for this model: `DATA_OK` and
+     * `DATA_ERROR`.
+     * Recommendation model cannot be trained if the data is in
+     * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even
+     * if serving state is `ACTIVE`: models were trained successfully before, but
+     * cannot be refreshed because model no longer has sufficient
+     * data for training.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The dataState. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model.DataState getDataState() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.Model.DataState result = + com.google.cloud.retail.v2beta.Model.DataState.valueOf(dataState_); + return result == null ? com.google.cloud.retail.v2beta.Model.DataState.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The state of data requirements for this model: `DATA_OK` and
+     * `DATA_ERROR`.
+     * Recommendation model cannot be trained if the data is in
+     * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even
+     * if serving state is `ACTIVE`: models were trained successfully before, but
+     * cannot be refreshed because model no longer has sufficient
+     * data for training.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The dataState to set. + * @return This builder for chaining. + */ + public Builder setDataState(com.google.cloud.retail.v2beta.Model.DataState value) { + if (value == null) { + throw new NullPointerException(); + } + + dataState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The state of data requirements for this model: `DATA_OK` and
+     * `DATA_ERROR`.
+     * Recommendation model cannot be trained if the data is in
+     * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even
+     * if serving state is `ACTIVE`: models were trained successfully before, but
+     * cannot be refreshed because model no longer has sufficient
+     * data for training.
+     * 
+ * + * + * .google.cloud.retail.v2beta.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearDataState() { + + dataState_ = 0; + onChanged(); + return this; + } + + private int filteringOption_ = 0; + /** + * + * + *
+     * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering
+     * by attributes is enabled for the model.
+     * 
+ * + * + * .google.cloud.retail.v2beta.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for filteringOption. + */ + @java.lang.Override + public int getFilteringOptionValue() { + return filteringOption_; + } + /** + * + * + *
+     * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering
+     * by attributes is enabled for the model.
+     * 
+ * + * + * .google.cloud.retail.v2beta.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for filteringOption to set. + * @return This builder for chaining. + */ + public Builder setFilteringOptionValue(int value) { + + filteringOption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering
+     * by attributes is enabled for the model.
+     * 
+ * + * + * .google.cloud.retail.v2beta.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The filteringOption. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.RecommendationsFilteringOption getFilteringOption() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.RecommendationsFilteringOption result = + com.google.cloud.retail.v2beta.RecommendationsFilteringOption.valueOf(filteringOption_); + return result == null + ? com.google.cloud.retail.v2beta.RecommendationsFilteringOption.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering
+     * by attributes is enabled for the model.
+     * 
+ * + * + * .google.cloud.retail.v2beta.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The filteringOption to set. + * @return This builder for chaining. + */ + public Builder setFilteringOption( + com.google.cloud.retail.v2beta.RecommendationsFilteringOption value) { + if (value == null) { + throw new NullPointerException(); + } + + filteringOption_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering
+     * by attributes is enabled for the model.
+     * 
+ * + * + * .google.cloud.retail.v2beta.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearFilteringOption() { + + filteringOption_ = 0; + onChanged(); + return this; + } + + private java.util.List + servingConfigLists_ = java.util.Collections.emptyList(); + + private void ensureServingConfigListsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + servingConfigLists_ = + new java.util.ArrayList( + servingConfigLists_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Model.ServingConfigList, + com.google.cloud.retail.v2beta.Model.ServingConfigList.Builder, + com.google.cloud.retail.v2beta.Model.ServingConfigListOrBuilder> + servingConfigListsBuilder_; + + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getServingConfigListsList() { + if (servingConfigListsBuilder_ == null) { + return java.util.Collections.unmodifiableList(servingConfigLists_); + } else { + return servingConfigListsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getServingConfigListsCount() { + if (servingConfigListsBuilder_ == null) { + return servingConfigLists_.size(); + } else { + return servingConfigListsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.Model.ServingConfigList getServingConfigLists(int index) { + if (servingConfigListsBuilder_ == null) { + return servingConfigLists_.get(index); + } else { + return servingConfigListsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setServingConfigLists( + int index, com.google.cloud.retail.v2beta.Model.ServingConfigList value) { + if (servingConfigListsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServingConfigListsIsMutable(); + servingConfigLists_.set(index, value); + onChanged(); + } else { + servingConfigListsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setServingConfigLists( + int index, com.google.cloud.retail.v2beta.Model.ServingConfigList.Builder builderForValue) { + if (servingConfigListsBuilder_ == null) { + ensureServingConfigListsIsMutable(); + servingConfigLists_.set(index, builderForValue.build()); + onChanged(); + } else { + servingConfigListsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addServingConfigLists( + com.google.cloud.retail.v2beta.Model.ServingConfigList value) { + if (servingConfigListsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServingConfigListsIsMutable(); + servingConfigLists_.add(value); + onChanged(); + } else { + servingConfigListsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addServingConfigLists( + int index, com.google.cloud.retail.v2beta.Model.ServingConfigList value) { + if (servingConfigListsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureServingConfigListsIsMutable(); + servingConfigLists_.add(index, value); + onChanged(); + } else { + servingConfigListsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addServingConfigLists( + com.google.cloud.retail.v2beta.Model.ServingConfigList.Builder builderForValue) { + if (servingConfigListsBuilder_ == null) { + ensureServingConfigListsIsMutable(); + servingConfigLists_.add(builderForValue.build()); + onChanged(); + } else { + servingConfigListsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addServingConfigLists( + int index, com.google.cloud.retail.v2beta.Model.ServingConfigList.Builder builderForValue) { + if (servingConfigListsBuilder_ == null) { + ensureServingConfigListsIsMutable(); + servingConfigLists_.add(index, builderForValue.build()); + onChanged(); + } else { + servingConfigListsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllServingConfigLists( + java.lang.Iterable + values) { + if (servingConfigListsBuilder_ == null) { + ensureServingConfigListsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, servingConfigLists_); + onChanged(); + } else { + servingConfigListsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearServingConfigLists() { + if (servingConfigListsBuilder_ == null) { + servingConfigLists_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + servingConfigListsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeServingConfigLists(int index) { + if (servingConfigListsBuilder_ == null) { + ensureServingConfigListsIsMutable(); + servingConfigLists_.remove(index); + onChanged(); + } else { + servingConfigListsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.Model.ServingConfigList.Builder + getServingConfigListsBuilder(int index) { + return getServingConfigListsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.Model.ServingConfigListOrBuilder + getServingConfigListsOrBuilder(int index) { + if (servingConfigListsBuilder_ == null) { + return servingConfigLists_.get(index); + } else { + return servingConfigListsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getServingConfigListsOrBuilderList() { + if (servingConfigListsBuilder_ != null) { + return servingConfigListsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(servingConfigLists_); + } + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.Model.ServingConfigList.Builder + addServingConfigListsBuilder() { + return getServingConfigListsFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.Model.ServingConfigList.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.Model.ServingConfigList.Builder + addServingConfigListsBuilder(int index) { + return getServingConfigListsFieldBuilder() + .addBuilder( + index, com.google.cloud.retail.v2beta.Model.ServingConfigList.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. The list of valid serving configs associated with the
+     * PageOptimizationConfig.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getServingConfigListsBuilderList() { + return getServingConfigListsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Model.ServingConfigList, + com.google.cloud.retail.v2beta.Model.ServingConfigList.Builder, + com.google.cloud.retail.v2beta.Model.ServingConfigListOrBuilder> + getServingConfigListsFieldBuilder() { + if (servingConfigListsBuilder_ == null) { + servingConfigListsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.Model.ServingConfigList, + com.google.cloud.retail.v2beta.Model.ServingConfigList.Builder, + com.google.cloud.retail.v2beta.Model.ServingConfigListOrBuilder>( + servingConfigLists_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + servingConfigLists_ = null; + } + return servingConfigListsBuilder_; + } + + @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.Model) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.Model) + private static final com.google.cloud.retail.v2beta.Model DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.Model(); + } + + public static com.google.cloud.retail.v2beta.Model getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Model parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Model(input, extensionRegistry); + } + }; + + 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.Model getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelName.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelName.java new file mode 100644 index 000000000000..d11f6e152502 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelName.java @@ -0,0 +1,257 @@ +/* + * Copyright 2022 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.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ModelName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CATALOG_MODEL = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/catalogs/{catalog}/models/{model}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String catalog; + private final String model; + + @Deprecated + protected ModelName() { + project = null; + location = null; + catalog = null; + model = null; + } + + private ModelName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + catalog = Preconditions.checkNotNull(builder.getCatalog()); + model = Preconditions.checkNotNull(builder.getModel()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getModel() { + return model; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ModelName of(String project, String location, String catalog, String model) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setModel(model) + .build(); + } + + public static String format(String project, String location, String catalog, String model) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCatalog(catalog) + .setModel(model) + .build() + .toString(); + } + + public static ModelName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CATALOG_MODEL.validatedMatch( + formattedString, "ModelName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("catalog"), + matchMap.get("model")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ModelName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CATALOG_MODEL.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (catalog != null) { + fieldMapBuilder.put("catalog", catalog); + } + if (model != null) { + fieldMapBuilder.put("model", model); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CATALOG_MODEL.instantiate( + "project", project, "location", location, "catalog", catalog, "model", model); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ModelName that = ((ModelName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.catalog, that.catalog) + && Objects.equals(this.model, that.model); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(catalog); + h *= 1000003; + h ^= Objects.hashCode(model); + return h; + } + + /** Builder for projects/{project}/locations/{location}/catalogs/{catalog}/models/{model}. */ + public static class Builder { + private String project; + private String location; + private String catalog; + private String model; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCatalog() { + return catalog; + } + + public String getModel() { + return model; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCatalog(String catalog) { + this.catalog = catalog; + return this; + } + + public Builder setModel(String model) { + this.model = model; + return this; + } + + private Builder(ModelName modelName) { + this.project = modelName.project; + this.location = modelName.location; + this.catalog = modelName.catalog; + this.model = modelName.model; + } + + public ModelName build() { + return new ModelName(this); + } + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelOrBuilder.java new file mode 100644 index 000000000000..0b5e244f74a5 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelOrBuilder.java @@ -0,0 +1,593 @@ +/* + * Copyright 2020 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/model.proto + +package com.google.cloud.retail.v2beta; + +public interface ModelOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.Model) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The fully qualified resource name of the model.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * catalog_id has char limit of 50.
+   * recommendation_model_id has char limit of 40.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The fully qualified resource name of the model.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * catalog_id has char limit of 50.
+   * recommendation_model_id has char limit of 40.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The display name of the model.
+   * Should be human readable, used to display Recommendation Models in the
+   * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024
+   * characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The display name of the model.
+   * Should be human readable, used to display Recommendation Models in the
+   * Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024
+   * characters.
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Optional. The training state that the model is in (e.g.
+   * `TRAINING` or `PAUSED`).
+   * Since part of the cost of running the service
+   * is frequency of training - this can be used to determine when to train
+   * model in order to control cost. If not specified: the default value for
+   * `CreateModel` method is `TRAINING`. The default value for
+   * `UpdateModel` method is to keep the state the same as before.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for trainingState. + */ + int getTrainingStateValue(); + /** + * + * + *
+   * Optional. The training state that the model is in (e.g.
+   * `TRAINING` or `PAUSED`).
+   * Since part of the cost of running the service
+   * is frequency of training - this can be used to determine when to train
+   * model in order to control cost. If not specified: the default value for
+   * `CreateModel` method is `TRAINING`. The default value for
+   * `UpdateModel` method is to keep the state the same as before.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.TrainingState training_state = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The trainingState. + */ + com.google.cloud.retail.v2beta.Model.TrainingState getTrainingState(); + + /** + * + * + *
+   * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for servingState. + */ + int getServingStateValue(); + /** + * + * + *
+   * Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.ServingState serving_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The servingState. + */ + com.google.cloud.retail.v2beta.Model.ServingState getServingState(); + + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was created at.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was created at.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was created at.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was last updated. E.g.
+   * if a Recommendation Model was paused - this would be the time the pause was
+   * initiated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was last updated. E.g.
+   * if a Recommendation Model was paused - this would be the time the pause was
+   * initiated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp the Recommendation Model was last updated. E.g.
+   * if a Recommendation Model was paused - this would be the time the pause was
+   * initiated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Required. The type of model e.g. `home-page`.
+   * Currently supported values: `recommended-for-you`, `others-you-may-like`,
+   * `frequently-bought-together`, `page-optimization`, `similar-items`,
+   * `buy-it-again`, and `recently-viewed`(readonly value).
+   * This field together with
+   * [optimization_objective][google.cloud.retail.v2beta.Model.optimization_objective]
+   * describe model metadata to use to control model training and serving.
+   * See https://cloud.google.com/retail/docs/models
+   * for more details on what the model metadata control and which combination
+   * of parameters are valid. For invalid combinations of parameters (e.g. type
+   * = `frequently-bought-together` and optimization_objective = `ctr`), you
+   * receive an error 400 if you try to create/update a recommendation with
+   * this set of knobs.
+   * 
+ * + * string type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * Required. The type of model e.g. `home-page`.
+   * Currently supported values: `recommended-for-you`, `others-you-may-like`,
+   * `frequently-bought-together`, `page-optimization`, `similar-items`,
+   * `buy-it-again`, and `recently-viewed`(readonly value).
+   * This field together with
+   * [optimization_objective][google.cloud.retail.v2beta.Model.optimization_objective]
+   * describe model metadata to use to control model training and serving.
+   * See https://cloud.google.com/retail/docs/models
+   * for more details on what the model metadata control and which combination
+   * of parameters are valid. For invalid combinations of parameters (e.g. type
+   * = `frequently-bought-together` and optimization_objective = `ctr`), you
+   * receive an error 400 if you try to create/update a recommendation with
+   * this set of knobs.
+   * 
+ * + * string type = 7 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Optional. The optimization objective e.g. `cvr`.
+   * Currently supported
+   * values: `ctr`, `cvr`, `revenue-per-order`.
+   *  If not specified, we choose default based on model type.
+   * Default depends on type of recommendation:
+   * `recommended-for-you` => `ctr`
+   * `others-you-may-like` => `ctr`
+   * `frequently-bought-together` => `revenue_per_order`
+   * This field together with
+   * [optimization_objective][google.cloud.retail.v2beta.Model.type]
+   * describe model metadata to use to control model training and serving.
+   * See https://cloud.google.com/retail/docs/models
+   * for more details on what the model metadata control and which combination
+   * of parameters are valid. For invalid combinations of parameters (e.g. type
+   * = `frequently-bought-together` and optimization_objective = `ctr`), you
+   * receive an error 400 if you try to create/update a recommendation with
+   * this set of knobs.
+   * 
+ * + * string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The optimizationObjective. + */ + java.lang.String getOptimizationObjective(); + /** + * + * + *
+   * Optional. The optimization objective e.g. `cvr`.
+   * Currently supported
+   * values: `ctr`, `cvr`, `revenue-per-order`.
+   *  If not specified, we choose default based on model type.
+   * Default depends on type of recommendation:
+   * `recommended-for-you` => `ctr`
+   * `others-you-may-like` => `ctr`
+   * `frequently-bought-together` => `revenue_per_order`
+   * This field together with
+   * [optimization_objective][google.cloud.retail.v2beta.Model.type]
+   * describe model metadata to use to control model training and serving.
+   * See https://cloud.google.com/retail/docs/models
+   * for more details on what the model metadata control and which combination
+   * of parameters are valid. For invalid combinations of parameters (e.g. type
+   * = `frequently-bought-together` and optimization_objective = `ctr`), you
+   * receive an error 400 if you try to create/update a recommendation with
+   * this set of knobs.
+   * 
+ * + * string optimization_objective = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for optimizationObjective. + */ + com.google.protobuf.ByteString getOptimizationObjectiveBytes(); + + /** + * + * + *
+   * Optional. The state of periodic tuning.
+   * The period we use is 3 months - to do a
+   * one-off tune earlier use the `TuneModel` method. Default value
+   * is `PERIODIC_TUNING_ENABLED`.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for periodicTuningState. + */ + int getPeriodicTuningStateValue(); + /** + * + * + *
+   * Optional. The state of periodic tuning.
+   * The period we use is 3 months - to do a
+   * one-off tune earlier use the `TuneModel` method. Default value
+   * is `PERIODIC_TUNING_ENABLED`.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.PeriodicTuningState periodic_tuning_state = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The periodicTuningState. + */ + com.google.cloud.retail.v2beta.Model.PeriodicTuningState getPeriodicTuningState(); + + /** + * + * + *
+   * Output only. The timestamp when the latest successful tune finished.
+   * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the lastTuneTime field is set. + */ + boolean hasLastTuneTime(); + /** + * + * + *
+   * Output only. The timestamp when the latest successful tune finished.
+   * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The lastTuneTime. + */ + com.google.protobuf.Timestamp getLastTuneTime(); + /** + * + * + *
+   * Output only. The timestamp when the latest successful tune finished.
+   * 
+ * + * + * .google.protobuf.Timestamp last_tune_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getLastTuneTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The tune operation associated with the model.
+   * Can be used to determine if there is an ongoing tune for this
+   * recommendation. Empty field implies no tune is goig on.
+   * 
+ * + * string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The tuningOperation. + */ + java.lang.String getTuningOperation(); + /** + * + * + *
+   * Output only. The tune operation associated with the model.
+   * Can be used to determine if there is an ongoing tune for this
+   * recommendation. Empty field implies no tune is goig on.
+   * 
+ * + * string tuning_operation = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for tuningOperation. + */ + com.google.protobuf.ByteString getTuningOperationBytes(); + + /** + * + * + *
+   * Output only. The state of data requirements for this model: `DATA_OK` and
+   * `DATA_ERROR`.
+   * Recommendation model cannot be trained if the data is in
+   * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even
+   * if serving state is `ACTIVE`: models were trained successfully before, but
+   * cannot be refreshed because model no longer has sufficient
+   * data for training.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for dataState. + */ + int getDataStateValue(); + /** + * + * + *
+   * Output only. The state of data requirements for this model: `DATA_OK` and
+   * `DATA_ERROR`.
+   * Recommendation model cannot be trained if the data is in
+   * `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even
+   * if serving state is `ACTIVE`: models were trained successfully before, but
+   * cannot be refreshed because model no longer has sufficient
+   * data for training.
+   * 
+ * + * + * .google.cloud.retail.v2beta.Model.DataState data_state = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The dataState. + */ + com.google.cloud.retail.v2beta.Model.DataState getDataState(); + + /** + * + * + *
+   * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering
+   * by attributes is enabled for the model.
+   * 
+ * + * + * .google.cloud.retail.v2beta.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for filteringOption. + */ + int getFilteringOptionValue(); + /** + * + * + *
+   * Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering
+   * by attributes is enabled for the model.
+   * 
+ * + * + * .google.cloud.retail.v2beta.RecommendationsFilteringOption filtering_option = 18 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The filteringOption. + */ + com.google.cloud.retail.v2beta.RecommendationsFilteringOption getFilteringOption(); + + /** + * + * + *
+   * Output only. The list of valid serving configs associated with the
+   * PageOptimizationConfig.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getServingConfigListsList(); + /** + * + * + *
+   * Output only. The list of valid serving configs associated with the
+   * PageOptimizationConfig.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2beta.Model.ServingConfigList getServingConfigLists(int index); + /** + * + * + *
+   * Output only. The list of valid serving configs associated with the
+   * PageOptimizationConfig.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getServingConfigListsCount(); + /** + * + * + *
+   * Output only. The list of valid serving configs associated with the
+   * PageOptimizationConfig.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getServingConfigListsOrBuilderList(); + /** + * + * + *
+   * Output only. The list of valid serving configs associated with the
+   * PageOptimizationConfig.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.Model.ServingConfigList serving_config_lists = 19 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2beta.Model.ServingConfigListOrBuilder getServingConfigListsOrBuilder( + int index); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelProto.java new file mode 100644 index 000000000000..502851d8f278 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelProto.java @@ -0,0 +1,144 @@ +/* + * Copyright 2020 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/model.proto + +package com.google.cloud.retail.v2beta; + +public final class ModelProto { + private ModelProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Model_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Model_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_Model_ServingConfigList_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_Model_ServingConfigList_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n&google/cloud/retail/v2beta/model.proto" + + "\022\032google.cloud.retail.v2beta\032\037google/api" + + "/field_behavior.proto\032\031google/api/resour" + + "ce.proto\032\'google/cloud/retail/v2beta/com" + + "mon.proto\032\037google/protobuf/timestamp.pro" + + "to\"\272\n\n\005Model\022\021\n\004name\030\001 \001(\tB\003\340A\002\022\031\n\014displ" + + "ay_name\030\002 \001(\tB\003\340A\002\022L\n\016training_state\030\003 \001" + + "(\0162/.google.cloud.retail.v2beta.Model.Tr" + + "ainingStateB\003\340A\001\022J\n\rserving_state\030\004 \001(\0162" + + "..google.cloud.retail.v2beta.Model.Servi" + + "ngStateB\003\340A\003\0224\n\013create_time\030\005 \001(\0132\032.goog" + + "le.protobuf.TimestampB\003\340A\003\0224\n\013update_tim" + + "e\030\006 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" + + "\022\021\n\004type\030\007 \001(\tB\003\340A\002\022#\n\026optimization_obje" + + "ctive\030\010 \001(\tB\003\340A\001\022Y\n\025periodic_tuning_stat" + + "e\030\013 \001(\01625.google.cloud.retail.v2beta.Mod" + + "el.PeriodicTuningStateB\003\340A\001\0227\n\016last_tune" + + "_time\030\014 \001(\0132\032.google.protobuf.TimestampB" + + "\003\340A\003\022\035\n\020tuning_operation\030\017 \001(\tB\003\340A\003\022D\n\nd" + + "ata_state\030\020 \001(\0162+.google.cloud.retail.v2" + + "beta.Model.DataStateB\003\340A\003\022Y\n\020filtering_o" + + "ption\030\022 \001(\0162:.google.cloud.retail.v2beta" + + ".RecommendationsFilteringOptionB\003\340A\001\022V\n\024" + + "serving_config_lists\030\023 \003(\01323.google.clou" + + "d.retail.v2beta.Model.ServingConfigListB" + + "\003\340A\003\0324\n\021ServingConfigList\022\037\n\022serving_con" + + "fig_ids\030\001 \003(\tB\003\340A\001\"R\n\014ServingState\022\035\n\031SE" + + "RVING_STATE_UNSPECIFIED\020\000\022\014\n\010INACTIVE\020\001\022" + + "\n\n\006ACTIVE\020\002\022\t\n\005TUNED\020\003\"I\n\rTrainingState\022" + + "\036\n\032TRAINING_STATE_UNSPECIFIED\020\000\022\n\n\006PAUSE" + + "D\020\001\022\014\n\010TRAINING\020\002\"\220\001\n\023PeriodicTuningStat" + + "e\022%\n!PERIODIC_TUNING_STATE_UNSPECIFIED\020\000" + + "\022\034\n\030PERIODIC_TUNING_DISABLED\020\001\022\027\n\023ALL_TU" + + "NING_DISABLED\020\003\022\033\n\027PERIODIC_TUNING_ENABL" + + "ED\020\002\"D\n\tDataState\022\032\n\026DATA_STATE_UNSPECIF" + + "IED\020\000\022\013\n\007DATA_OK\020\001\022\016\n\nDATA_ERROR\020\002:k\352Ah\n" + + "\033retail.googleapis.com/Model\022Iprojects/{" + + "project}/locations/{location}/catalogs/{" + + "catalog}/models/{model}B\323\001\n\036com.google.c" + + "loud.retail.v2betaB\nModelProtoP\001Z@google" + + ".golang.org/genproto/googleapis/cloud/re" + + "tail/v2beta;retail\242\002\006RETAIL\252\002\032Google.Clo" + + "ud.Retail.V2Beta\312\002\032Google\\Cloud\\Retail\\V" + + "2beta\352\002\035Google::Cloud::Retail::V2betab\006p" + + "roto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.retail.v2beta.CommonProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_Model_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_Model_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Model_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "TrainingState", + "ServingState", + "CreateTime", + "UpdateTime", + "Type", + "OptimizationObjective", + "PeriodicTuningState", + "LastTuneTime", + "TuningOperation", + "DataState", + "FilteringOption", + "ServingConfigLists", + }); + internal_static_google_cloud_retail_v2beta_Model_ServingConfigList_descriptor = + internal_static_google_cloud_retail_v2beta_Model_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_retail_v2beta_Model_ServingConfigList_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_Model_ServingConfigList_descriptor, + new java.lang.String[] { + "ServingConfigIds", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.retail.v2beta.CommonProto.getDescriptor(); + com.google.protobuf.TimestampProto.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/ModelServiceProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelServiceProto.java new file mode 100644 index 000000000000..45946e14bf60 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ModelServiceProto.java @@ -0,0 +1,280 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public final class ModelServiceProto { + private ModelServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CreateModelRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CreateModelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_UpdateModelRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_UpdateModelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_PauseModelRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_PauseModelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ResumeModelRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ResumeModelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ListModelsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ListModelsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_DeleteModelRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_DeleteModelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_ListModelsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_ListModelsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_TuneModelRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_TuneModelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_CreateModelMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_CreateModelMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_TuneModelMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_TuneModelMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_retail_v2beta_TuneModelResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_retail_v2beta_TuneModelResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n.google/cloud/retail/v2beta/model_servi" + + "ce.proto\022\032google.cloud.retail.v2beta\032\034go" + + "ogle/api/annotations.proto\032\027google/api/c" + + "lient.proto\032\037google/api/field_behavior.p" + + "roto\032\031google/api/resource.proto\032&google/" + + "cloud/retail/v2beta/model.proto\032#google/" + + "longrunning/operations.proto\032\033google/pro" + + "tobuf/empty.proto\032 google/protobuf/field" + + "_mask.proto\"\230\001\n\022CreateModelRequest\0225\n\006pa" + + "rent\030\001 \001(\tB%\340A\002\372A\037\n\035retail.googleapis.co" + + "m/Catalog\0225\n\005model\030\002 \001(\0132!.google.cloud." + + "retail.v2beta.ModelB\003\340A\002\022\024\n\007dry_run\030\003 \001(" + + "\010B\003\340A\001\"\201\001\n\022UpdateModelRequest\0225\n\005model\030\001" + + " \001(\0132!.google.cloud.retail.v2beta.ModelB" + + "\003\340A\002\0224\n\013update_mask\030\002 \001(\0132\032.google.proto" + + "buf.FieldMaskB\003\340A\001\"F\n\021PauseModelRequest\022" + + "1\n\004name\030\001 \001(\tB#\340A\002\372A\035\n\033retail.googleapis" + + ".com/Model\"\'\n\022ResumeModelRequest\022\021\n\004name" + + "\030\001 \001(\tB\003\340A\002\"{\n\021ListModelsRequest\0225\n\006pare" + + "nt\030\001 \001(\tB%\340A\002\372A\037\n\035retail.googleapis.com/" + + "Catalog\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_" + + "token\030\003 \001(\tB\003\340A\001\"G\n\022DeleteModelRequest\0221" + + "\n\004name\030\001 \001(\tB#\340A\002\372A\035\n\033retail.googleapis." + + "com/Model\"`\n\022ListModelsResponse\0221\n\006model" + + "s\030\001 \003(\0132!.google.cloud.retail.v2beta.Mod" + + "el\022\027\n\017next_page_token\030\002 \001(\t\"E\n\020TuneModel" + + "Request\0221\n\004name\030\001 \001(\tB#\340A\002\372A\035\n\033retail.go" + + "ogleapis.com/Model\"$\n\023CreateModelMetadat" + + "a\022\r\n\005model\030\001 \001(\t\"\"\n\021TuneModelMetadata\022\r\n" + + "\005model\030\001 \001(\t\"\023\n\021TuneModelResponse2\202\014\n\014Mo" + + "delService\022\213\002\n\013CreateModel\022..google.clou" + + "d.retail.v2beta.CreateModelRequest\032\035.goo" + + "gle.longrunning.Operation\"\254\001\202\323\344\223\002B\"9/v2b" + + "eta/{parent=projects/*/locations/*/catal" + + "ogs/*}/models:\005model\332A\014parent,model\312AR\n " + + "google.cloud.retail.v2beta.Model\022.google" + + ".cloud.retail.v2beta.CreateModelMetadata" + + "\022\261\001\n\nPauseModel\022-.google.cloud.retail.v2" + + "beta.PauseModelRequest\032!.google.cloud.re" + + "tail.v2beta.Model\"Q\202\323\344\223\002D\"?/v2beta/{name" + + "=projects/*/locations/*/catalogs/*/model" + + "s/*}:pause:\001*\332A\004name\022\264\001\n\013ResumeModel\022..g" + + "oogle.cloud.retail.v2beta.ResumeModelReq" + + "uest\032!.google.cloud.retail.v2beta.Model\"" + + "R\202\323\344\223\002E\"@/v2beta/{name=projects/*/locati" + + "ons/*/catalogs/*/models/*}:resume:\001*\332A\004n" + + "ame\022\237\001\n\013DeleteModel\022..google.cloud.retai" + + "l.v2beta.DeleteModelRequest\032\026.google.pro" + + "tobuf.Empty\"H\202\323\344\223\002;*9/v2beta/{name=proje" + + "cts/*/locations/*/catalogs/*/models/*}\332A" + + "\004name\022\267\001\n\nListModels\022-.google.cloud.reta" + + "il.v2beta.ListModelsRequest\032..google.clo" + + "ud.retail.v2beta.ListModelsResponse\"J\202\323\344" + + "\223\002;\0229/v2beta/{parent=projects/*/location" + + "s/*/catalogs/*}/models\332A\006parent\022\304\001\n\013Upda" + + "teModel\022..google.cloud.retail.v2beta.Upd" + + "ateModelRequest\032!.google.cloud.retail.v2" + + "beta.Model\"b\202\323\344\223\002H2?/v2beta/{model.name=" + + "projects/*/locations/*/catalogs/*/models" + + "/*}:\005model\332A\021model,update_mask\022\212\002\n\tTuneM" + + "odel\022,.google.cloud.retail.v2beta.TuneMo" + + "delRequest\032\035.google.longrunning.Operatio" + + "n\"\257\001\202\323\344\223\002C\">/v2beta/{name=projects/*/loc" + + "ations/*/catalogs/*/models/*}:tune:\001*\332A\004" + + "name\312A\\\n,google.cloud.retail.v2beta.Tune" + + "ModelResponse\022,google.cloud.retail.v2bet" + + "a.TuneModelMetadata\032I\312A\025retail.googleapi" + + "s.com\322A.https://www.googleapis.com/auth/" + + "cloud-platformB\332\001\n\036com.google.cloud.reta" + + "il.v2betaB\021ModelServiceProtoP\001Z@google.g" + + "olang.org/genproto/googleapis/cloud/reta" + + "il/v2beta;retail\242\002\006RETAIL\252\002\032Google.Cloud" + + ".Retail.V2Beta\312\002\032Google\\Cloud\\Retail\\V2b" + + "eta\352\002\035Google::Cloud::Retail::V2betab\006pro" + + "to3" + }; + 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.ModelProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + }); + internal_static_google_cloud_retail_v2beta_CreateModelRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_retail_v2beta_CreateModelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CreateModelRequest_descriptor, + new java.lang.String[] { + "Parent", "Model", "DryRun", + }); + internal_static_google_cloud_retail_v2beta_UpdateModelRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_retail_v2beta_UpdateModelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_UpdateModelRequest_descriptor, + new java.lang.String[] { + "Model", "UpdateMask", + }); + internal_static_google_cloud_retail_v2beta_PauseModelRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_retail_v2beta_PauseModelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_PauseModelRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_ResumeModelRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_retail_v2beta_ResumeModelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ResumeModelRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_ListModelsRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_retail_v2beta_ListModelsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ListModelsRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_retail_v2beta_DeleteModelRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_retail_v2beta_DeleteModelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_DeleteModelRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_ListModelsResponse_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_retail_v2beta_ListModelsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_ListModelsResponse_descriptor, + new java.lang.String[] { + "Models", "NextPageToken", + }); + internal_static_google_cloud_retail_v2beta_TuneModelRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_retail_v2beta_TuneModelRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_TuneModelRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_retail_v2beta_CreateModelMetadata_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_retail_v2beta_CreateModelMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_CreateModelMetadata_descriptor, + new java.lang.String[] { + "Model", + }); + internal_static_google_cloud_retail_v2beta_TuneModelMetadata_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_retail_v2beta_TuneModelMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_TuneModelMetadata_descriptor, + new java.lang.String[] { + "Model", + }); + internal_static_google_cloud_retail_v2beta_TuneModelResponse_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_retail_v2beta_TuneModelResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_retail_v2beta_TuneModelResponse_descriptor, + new java.lang.String[] {}); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.methodSignature); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + 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.ModelProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.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/PauseModelRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PauseModelRequest.java new file mode 100644 index 000000000000..72a80e391366 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PauseModelRequest.java @@ -0,0 +1,665 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for pausing training of a model.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PauseModelRequest} + */ +public final class PauseModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.PauseModelRequest) + PauseModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PauseModelRequest.newBuilder() to construct. + private PauseModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PauseModelRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PauseModelRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PauseModelRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_PauseModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_PauseModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PauseModelRequest.class, + com.google.cloud.retail.v2beta.PauseModelRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the model to pause.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the model to pause.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.PauseModelRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.PauseModelRequest other = + (com.google.cloud.retail.v2beta.PauseModelRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.PauseModelRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PauseModelRequest 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.PauseModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PauseModelRequest 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.PauseModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.PauseModelRequest 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.PauseModelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PauseModelRequest 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.PauseModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.PauseModelRequest 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.PauseModelRequest 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.PauseModelRequest 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.PauseModelRequest 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 for pausing training of a model.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.PauseModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.PauseModelRequest) + com.google.cloud.retail.v2beta.PauseModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_PauseModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_PauseModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.PauseModelRequest.class, + com.google.cloud.retail.v2beta.PauseModelRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.PauseModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_PauseModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PauseModelRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.PauseModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PauseModelRequest build() { + com.google.cloud.retail.v2beta.PauseModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.PauseModelRequest buildPartial() { + com.google.cloud.retail.v2beta.PauseModelRequest result = + new com.google.cloud.retail.v2beta.PauseModelRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @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.PauseModelRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.PauseModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.PauseModelRequest other) { + if (other == com.google.cloud.retail.v2beta.PauseModelRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.PauseModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.PauseModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the model to pause.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the model to pause.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the model to pause.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the model to pause.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the model to pause.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + 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.PauseModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.PauseModelRequest) + private static final com.google.cloud.retail.v2beta.PauseModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.PauseModelRequest(); + } + + public static com.google.cloud.retail.v2beta.PauseModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PauseModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PauseModelRequest(input, extensionRegistry); + } + }; + + 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.PauseModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PauseModelRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PauseModelRequestOrBuilder.java new file mode 100644 index 000000000000..229e3f21e4f4 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PauseModelRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public interface PauseModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.PauseModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the model to pause.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the model to pause.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequest.java index e1813dcede14..31be8b2fe052 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequest.java @@ -364,10 +364,10 @@ public com.google.cloud.retail.v2beta.UserEventOrBuilder getUserEventOrBuilder() * * *
-   * Maximum number of results to return per page. Set this property
-   * to the number of prediction results needed. If zero, the service will
-   * choose a reasonable default. The maximum allowed value is 100. Values
-   * above 100 will be coerced to 100.
+   * Maximum number of results to return. Set this property to the number of
+   * prediction results needed. If zero, the service will choose a reasonable
+   * default. The maximum allowed value is 100. Values above 100 will be coerced
+   * to 100.
    * 
* * int32 page_size = 3; @@ -385,14 +385,17 @@ public int getPageSize() { * * *
-   * This field is not used for now; leave it unset.
+   * This field is not used; leave it unset.
    * 
* - * string page_token = 4; + * string page_token = 4 [deprecated = true]; * + * @deprecated google.cloud.retail.v2beta.PredictRequest.page_token is deprecated. See + * google/cloud/retail/v2beta/prediction_service.proto;l=94 * @return The pageToken. */ @java.lang.Override + @java.lang.Deprecated public java.lang.String getPageToken() { java.lang.Object ref = pageToken_; if (ref instanceof java.lang.String) { @@ -408,14 +411,17 @@ public java.lang.String getPageToken() { * * *
-   * This field is not used for now; leave it unset.
+   * This field is not used; leave it unset.
    * 
* - * string page_token = 4; + * string page_token = 4 [deprecated = true]; * + * @deprecated google.cloud.retail.v2beta.PredictRequest.page_token is deprecated. See + * google/cloud/retail/v2beta/prediction_service.proto;l=94 * @return The bytes for pageToken. */ @java.lang.Override + @java.lang.Deprecated public com.google.protobuf.ByteString getPageTokenBytes() { java.lang.Object ref = pageToken_; if (ref instanceof java.lang.String) { @@ -1863,10 +1869,10 @@ public com.google.cloud.retail.v2beta.UserEventOrBuilder getUserEventOrBuilder() * * *
-     * Maximum number of results to return per page. Set this property
-     * to the number of prediction results needed. If zero, the service will
-     * choose a reasonable default. The maximum allowed value is 100. Values
-     * above 100 will be coerced to 100.
+     * Maximum number of results to return. Set this property to the number of
+     * prediction results needed. If zero, the service will choose a reasonable
+     * default. The maximum allowed value is 100. Values above 100 will be coerced
+     * to 100.
      * 
* * int32 page_size = 3; @@ -1881,10 +1887,10 @@ public int getPageSize() { * * *
-     * Maximum number of results to return per page. Set this property
-     * to the number of prediction results needed. If zero, the service will
-     * choose a reasonable default. The maximum allowed value is 100. Values
-     * above 100 will be coerced to 100.
+     * Maximum number of results to return. Set this property to the number of
+     * prediction results needed. If zero, the service will choose a reasonable
+     * default. The maximum allowed value is 100. Values above 100 will be coerced
+     * to 100.
      * 
* * int32 page_size = 3; @@ -1902,10 +1908,10 @@ public Builder setPageSize(int value) { * * *
-     * Maximum number of results to return per page. Set this property
-     * to the number of prediction results needed. If zero, the service will
-     * choose a reasonable default. The maximum allowed value is 100. Values
-     * above 100 will be coerced to 100.
+     * Maximum number of results to return. Set this property to the number of
+     * prediction results needed. If zero, the service will choose a reasonable
+     * default. The maximum allowed value is 100. Values above 100 will be coerced
+     * to 100.
      * 
* * int32 page_size = 3; @@ -1924,13 +1930,16 @@ public Builder clearPageSize() { * * *
-     * This field is not used for now; leave it unset.
+     * This field is not used; leave it unset.
      * 
* - * string page_token = 4; + * string page_token = 4 [deprecated = true]; * + * @deprecated google.cloud.retail.v2beta.PredictRequest.page_token is deprecated. See + * google/cloud/retail/v2beta/prediction_service.proto;l=94 * @return The pageToken. */ + @java.lang.Deprecated public java.lang.String getPageToken() { java.lang.Object ref = pageToken_; if (!(ref instanceof java.lang.String)) { @@ -1946,13 +1955,16 @@ public java.lang.String getPageToken() { * * *
-     * This field is not used for now; leave it unset.
+     * This field is not used; leave it unset.
      * 
* - * string page_token = 4; + * string page_token = 4 [deprecated = true]; * + * @deprecated google.cloud.retail.v2beta.PredictRequest.page_token is deprecated. See + * google/cloud/retail/v2beta/prediction_service.proto;l=94 * @return The bytes for pageToken. */ + @java.lang.Deprecated public com.google.protobuf.ByteString getPageTokenBytes() { java.lang.Object ref = pageToken_; if (ref instanceof String) { @@ -1968,14 +1980,17 @@ public com.google.protobuf.ByteString getPageTokenBytes() { * * *
-     * This field is not used for now; leave it unset.
+     * This field is not used; leave it unset.
      * 
* - * string page_token = 4; + * string page_token = 4 [deprecated = true]; * + * @deprecated google.cloud.retail.v2beta.PredictRequest.page_token is deprecated. See + * google/cloud/retail/v2beta/prediction_service.proto;l=94 * @param value The pageToken to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setPageToken(java.lang.String value) { if (value == null) { throw new NullPointerException(); @@ -1989,13 +2004,16 @@ public Builder setPageToken(java.lang.String value) { * * *
-     * This field is not used for now; leave it unset.
+     * This field is not used; leave it unset.
      * 
* - * string page_token = 4; + * string page_token = 4 [deprecated = true]; * + * @deprecated google.cloud.retail.v2beta.PredictRequest.page_token is deprecated. See + * google/cloud/retail/v2beta/prediction_service.proto;l=94 * @return This builder for chaining. */ + @java.lang.Deprecated public Builder clearPageToken() { pageToken_ = getDefaultInstance().getPageToken(); @@ -2006,14 +2024,17 @@ public Builder clearPageToken() { * * *
-     * This field is not used for now; leave it unset.
+     * This field is not used; leave it unset.
      * 
* - * string page_token = 4; + * string page_token = 4 [deprecated = true]; * + * @deprecated google.cloud.retail.v2beta.PredictRequest.page_token is deprecated. See + * google/cloud/retail/v2beta/prediction_service.proto;l=94 * @param value The bytes for pageToken to set. * @return This builder for chaining. */ + @java.lang.Deprecated public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequestOrBuilder.java index 458b3ad4c539..8a88463196e1 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictRequestOrBuilder.java @@ -153,10 +153,10 @@ public interface PredictRequestOrBuilder * * *
-   * Maximum number of results to return per page. Set this property
-   * to the number of prediction results needed. If zero, the service will
-   * choose a reasonable default. The maximum allowed value is 100. Values
-   * above 100 will be coerced to 100.
+   * Maximum number of results to return. Set this property to the number of
+   * prediction results needed. If zero, the service will choose a reasonable
+   * default. The maximum allowed value is 100. Values above 100 will be coerced
+   * to 100.
    * 
* * int32 page_size = 3; @@ -169,25 +169,31 @@ public interface PredictRequestOrBuilder * * *
-   * This field is not used for now; leave it unset.
+   * This field is not used; leave it unset.
    * 
* - * string page_token = 4; + * string page_token = 4 [deprecated = true]; * + * @deprecated google.cloud.retail.v2beta.PredictRequest.page_token is deprecated. See + * google/cloud/retail/v2beta/prediction_service.proto;l=94 * @return The pageToken. */ + @java.lang.Deprecated java.lang.String getPageToken(); /** * * *
-   * This field is not used for now; leave it unset.
+   * This field is not used; leave it unset.
    * 
* - * string page_token = 4; + * string page_token = 4 [deprecated = true]; * + * @deprecated google.cloud.retail.v2beta.PredictRequest.page_token is deprecated. See + * google/cloud/retail/v2beta/prediction_service.proto;l=94 * @return The bytes for pageToken. */ + @java.lang.Deprecated com.google.protobuf.ByteString getPageTokenBytes(); /** diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceProto.java index a4c570778fa5..912cf40ad3c1 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceProto.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/PredictionServiceProto.java @@ -64,44 +64,45 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "service.proto\022\032google.cloud.retail.v2bet" + "a\032\034google/api/annotations.proto\032\027google/" + "api/client.proto\032\037google/api/field_behav" - + "ior.proto\032+google/cloud/retail/v2beta/us" - + "er_event.proto\032\034google/protobuf/struct.p" - + "roto\"\274\003\n\016PredictRequest\022\026\n\tplacement\030\001 \001" - + "(\tB\003\340A\002\022>\n\nuser_event\030\002 \001(\0132%.google.clo" - + "ud.retail.v2beta.UserEventB\003\340A\002\022\021\n\tpage_" - + "size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\022\016\n\006filter" - + "\030\005 \001(\t\022\025\n\rvalidate_only\030\006 \001(\010\022F\n\006params\030" - + "\007 \003(\01326.google.cloud.retail.v2beta.Predi" - + "ctRequest.ParamsEntry\022F\n\006labels\030\010 \003(\01326." - + "google.cloud.retail.v2beta.PredictReques" - + "t.LabelsEntry\032E\n\013ParamsEntry\022\013\n\003key\030\001 \001(" - + "\t\022%\n\005value\030\002 \001(\0132\026.google.protobuf.Value" - + ":\0028\001\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005valu" - + "e\030\002 \001(\t:\0028\001\"\357\002\n\017PredictResponse\022M\n\007resul" - + "ts\030\001 \003(\0132<.google.cloud.retail.v2beta.Pr" - + "edictResponse.PredictionResult\022\031\n\021attrib" - + "ution_token\030\002 \001(\t\022\023\n\013missing_ids\030\003 \003(\t\022\025" - + "\n\rvalidate_only\030\004 \001(\010\032\305\001\n\020PredictionResu" - + "lt\022\n\n\002id\030\001 \001(\t\022\\\n\010metadata\030\002 \003(\0132J.googl" - + "e.cloud.retail.v2beta.PredictResponse.Pr" - + "edictionResult.MetadataEntry\032G\n\rMetadata" - + "Entry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.goog" - + "le.protobuf.Value:\0028\0012\361\002\n\021PredictionServ" - + "ice\022\220\002\n\007Predict\022*.google.cloud.retail.v2" - + "beta.PredictRequest\032+.google.cloud.retai" - + "l.v2beta.PredictResponse\"\253\001\202\323\344\223\002\244\001\"J/v2b" - + "eta/{placement=projects/*/locations/*/ca" - + "talogs/*/placements/*}:predict:\001*ZS\"N/v2" - + "beta/{placement=projects/*/locations/*/c" - + "atalogs/*/servingConfigs/*}:predict:\001*\032I" - + "\312A\025retail.googleapis.com\322A.https://www.g" - + "oogleapis.com/auth/cloud-platformB\337\001\n\036co" - + "m.google.cloud.retail.v2betaB\026Prediction" - + "ServiceProtoP\001Z@google.golang.org/genpro" - + "to/googleapis/cloud/retail/v2beta;retail" - + "\242\002\006RETAIL\252\002\032Google.Cloud.Retail.V2Beta\312\002" - + "\032Google\\Cloud\\Retail\\V2beta\352\002\035Google::Cl" - + "oud::Retail::V2betab\006proto3" + + "ior.proto\032\031google/api/resource.proto\032+go" + + "ogle/cloud/retail/v2beta/user_event.prot" + + "o\032\034google/protobuf/struct.proto\"\300\003\n\016Pred" + + "ictRequest\022\026\n\tplacement\030\001 \001(\tB\003\340A\002\022>\n\nus" + + "er_event\030\002 \001(\0132%.google.cloud.retail.v2b" + + "eta.UserEventB\003\340A\002\022\021\n\tpage_size\030\003 \001(\005\022\026\n" + + "\npage_token\030\004 \001(\tB\002\030\001\022\016\n\006filter\030\005 \001(\t\022\025\n" + + "\rvalidate_only\030\006 \001(\010\022F\n\006params\030\007 \003(\01326.g" + + "oogle.cloud.retail.v2beta.PredictRequest" + + ".ParamsEntry\022F\n\006labels\030\010 \003(\01326.google.cl" + + "oud.retail.v2beta.PredictRequest.LabelsE" + + "ntry\032E\n\013ParamsEntry\022\013\n\003key\030\001 \001(\t\022%\n\005valu" + + "e\030\002 \001(\0132\026.google.protobuf.Value:\0028\001\032-\n\013L" + + "abelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\002" + + "8\001\"\357\002\n\017PredictResponse\022M\n\007results\030\001 \003(\0132" + + "<.google.cloud.retail.v2beta.PredictResp" + + "onse.PredictionResult\022\031\n\021attribution_tok" + + "en\030\002 \001(\t\022\023\n\013missing_ids\030\003 \003(\t\022\025\n\rvalidat" + + "e_only\030\004 \001(\010\032\305\001\n\020PredictionResult\022\n\n\002id\030" + + "\001 \001(\t\022\\\n\010metadata\030\002 \003(\0132J.google.cloud.r" + + "etail.v2beta.PredictResponse.PredictionR" + + "esult.MetadataEntry\032G\n\rMetadataEntry\022\013\n\003" + + "key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.google.protob" + + "uf.Value:\0028\0012\361\002\n\021PredictionService\022\220\002\n\007P" + + "redict\022*.google.cloud.retail.v2beta.Pred" + + "ictRequest\032+.google.cloud.retail.v2beta." + + "PredictResponse\"\253\001\202\323\344\223\002\244\001\"J/v2beta/{plac" + + "ement=projects/*/locations/*/catalogs/*/" + + "placements/*}:predict:\001*ZS\"N/v2beta/{pla" + + "cement=projects/*/locations/*/catalogs/*" + + "/servingConfigs/*}:predict:\001*\032I\312A\025retail" + + ".googleapis.com\322A.https://www.googleapis" + + ".com/auth/cloud-platformB\337\001\n\036com.google." + + "cloud.retail.v2betaB\026PredictionServicePr" + + "otoP\001Z@google.golang.org/genproto/google" + + "apis/cloud/retail/v2beta;retail\242\002\006RETAIL" + + "\252\002\032Google.Cloud.Retail.V2Beta\312\002\032Google\\C" + + "loud\\Retail\\V2beta\352\002\035Google::Cloud::Reta" + + "il::V2betab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -110,6 +111,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { 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.UserEventProto.getDescriptor(), com.google.protobuf.StructProto.getDescriptor(), }); @@ -187,6 +189,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { 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.UserEventProto.getDescriptor(); com.google.protobuf.StructProto.getDescriptor(); } diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Product.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Product.java index 10fc790bb76f..03edaad93826 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Product.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Product.java @@ -61,6 +61,7 @@ private Product() { conditions_ = com.google.protobuf.LazyStringArrayList.EMPTY; promotions_ = java.util.Collections.emptyList(); variants_ = java.util.Collections.emptyList(); + localInventories_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -459,6 +460,18 @@ private Product( com.google.cloud.retail.v2beta.Promotion.parser(), extensionRegistry)); break; } + case 282: + { + if (!((mutable_bitField0_ & 0x00002000) != 0)) { + localInventories_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00002000; + } + localInventories_.add( + input.readMessage( + com.google.cloud.retail.v2beta.LocalInventory.parser(), extensionRegistry)); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -511,6 +524,9 @@ private Product( if (((mutable_bitField0_ & 0x00000800) != 0)) { promotions_ = java.util.Collections.unmodifiableList(promotions_); } + if (((mutable_bitField0_ & 0x00002000) != 0)) { + localInventories_ = java.util.Collections.unmodifiableList(localInventories_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -1459,7 +1475,7 @@ public com.google.protobuf.ByteString getPrimaryProductIdBytes() { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -1482,7 +1498,7 @@ public com.google.protobuf.ProtocolStringList getCollectionMemberIdsList() { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -1505,7 +1521,7 @@ public int getCollectionMemberIdsCount() { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -1529,7 +1545,7 @@ public java.lang.String getCollectionMemberIds(int index) { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -1628,7 +1644,7 @@ public com.google.protobuf.ByteString getGtinBytes() { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -1668,7 +1684,7 @@ public com.google.protobuf.ProtocolStringList getCategoriesList() { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -1708,7 +1724,7 @@ public int getCategoriesCount() { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -1749,7 +1765,7 @@ public java.lang.String getCategories(int index) { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -3795,6 +3811,116 @@ public com.google.cloud.retail.v2beta.ProductOrBuilder getVariantsOrBuilder(int return variants_.get(index); } + public static final int LOCAL_INVENTORIES_FIELD_NUMBER = 35; + private java.util.List localInventories_; + /** + * + * + *
+   * Output only. A list of local inventories specific to different places.
+   * This is only available for users who have Retail Search enabled, and it can
+   * be managed by
+   * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+   * and
+   * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+   * APIs.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getLocalInventoriesList() { + return localInventories_; + } + /** + * + * + *
+   * Output only. A list of local inventories specific to different places.
+   * This is only available for users who have Retail Search enabled, and it can
+   * be managed by
+   * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+   * and
+   * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+   * APIs.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getLocalInventoriesOrBuilderList() { + return localInventories_; + } + /** + * + * + *
+   * Output only. A list of local inventories specific to different places.
+   * This is only available for users who have Retail Search enabled, and it can
+   * be managed by
+   * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+   * and
+   * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+   * APIs.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getLocalInventoriesCount() { + return localInventories_.size(); + } + /** + * + * + *
+   * Output only. A list of local inventories specific to different places.
+   * This is only available for users who have Retail Search enabled, and it can
+   * be managed by
+   * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+   * and
+   * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+   * APIs.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.LocalInventory getLocalInventories(int index) { + return localInventories_.get(index); + } + /** + * + * + *
+   * Output only. A list of local inventories specific to different places.
+   * This is only available for users who have Retail Search enabled, and it can
+   * be managed by
+   * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+   * and
+   * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+   * APIs.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.LocalInventoryOrBuilder getLocalInventoriesOrBuilder( + int index) { + return localInventories_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -3909,6 +4035,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < promotions_.size(); i++) { output.writeMessage(34, promotions_.get(i)); } + for (int i = 0; i < localInventories_.size(); i++) { + output.writeMessage(35, localInventories_.get(i)); + } unknownFields.writeTo(output); } @@ -4071,6 +4200,10 @@ public int getSerializedSize() { for (int i = 0; i < promotions_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(34, promotions_.get(i)); } + for (int i = 0; i < localInventories_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(35, localInventories_.get(i)); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -4141,6 +4274,7 @@ public boolean equals(final java.lang.Object obj) { if (!getRetrievableFields().equals(other.getRetrievableFields())) return false; } if (!getVariantsList().equals(other.getVariantsList())) return false; + if (!getLocalInventoriesList().equals(other.getLocalInventoriesList())) return false; if (!getExpirationCase().equals(other.getExpirationCase())) return false; switch (expirationCase_) { case 16: @@ -4267,6 +4401,10 @@ public int hashCode() { hash = (37 * hash) + VARIANTS_FIELD_NUMBER; hash = (53 * hash) + getVariantsList().hashCode(); } + if (getLocalInventoriesCount() > 0) { + hash = (37 * hash) + LOCAL_INVENTORIES_FIELD_NUMBER; + hash = (53 * hash) + getLocalInventoriesList().hashCode(); + } switch (expirationCase_) { case 16: hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; @@ -4444,6 +4582,7 @@ private void maybeForceBuilderInitialization() { getImagesFieldBuilder(); getPromotionsFieldBuilder(); getVariantsFieldBuilder(); + getLocalInventoriesFieldBuilder(); } } @@ -4559,6 +4698,12 @@ public Builder clear() { } else { variantsBuilder_.clear(); } + if (localInventoriesBuilder_ == null) { + localInventories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + } else { + localInventoriesBuilder_.clear(); + } expirationCase_ = 0; expiration_ = null; return this; @@ -4731,6 +4876,15 @@ public com.google.cloud.retail.v2beta.Product buildPartial() { } else { result.variants_ = variantsBuilder_.build(); } + if (localInventoriesBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0)) { + localInventories_ = java.util.Collections.unmodifiableList(localInventories_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.localInventories_ = localInventories_; + } else { + result.localInventories_ = localInventoriesBuilder_.build(); + } result.expirationCase_ = expirationCase_; onBuilt(); return result; @@ -5032,6 +5186,33 @@ public Builder mergeFrom(com.google.cloud.retail.v2beta.Product other) { } } } + if (localInventoriesBuilder_ == null) { + if (!other.localInventories_.isEmpty()) { + if (localInventories_.isEmpty()) { + localInventories_ = other.localInventories_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensureLocalInventoriesIsMutable(); + localInventories_.addAll(other.localInventories_); + } + onChanged(); + } + } else { + if (!other.localInventories_.isEmpty()) { + if (localInventoriesBuilder_.isEmpty()) { + localInventoriesBuilder_.dispose(); + localInventoriesBuilder_ = null; + localInventories_ = other.localInventories_; + bitField0_ = (bitField0_ & ~0x00002000); + localInventoriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getLocalInventoriesFieldBuilder() + : null; + } else { + localInventoriesBuilder_.addAllMessages(other.localInventories_); + } + } + } switch (other.getExpirationCase()) { case EXPIRE_TIME: { @@ -6358,7 +6539,7 @@ private void ensureCollectionMemberIdsIsMutable() { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -6381,7 +6562,7 @@ public com.google.protobuf.ProtocolStringList getCollectionMemberIdsList() { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -6404,7 +6585,7 @@ public int getCollectionMemberIdsCount() { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -6428,7 +6609,7 @@ public java.lang.String getCollectionMemberIds(int index) { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -6452,7 +6633,7 @@ public com.google.protobuf.ByteString getCollectionMemberIdsBytes(int index) { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -6483,7 +6664,7 @@ public Builder setCollectionMemberIds(int index, java.lang.String value) { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -6513,7 +6694,7 @@ public Builder addCollectionMemberIds(java.lang.String value) { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -6540,7 +6721,7 @@ public Builder addAllCollectionMemberIds(java.lang.Iterable va * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -6566,7 +6747,7 @@ public Builder clearCollectionMemberIds() { * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -6775,7 +6956,7 @@ private void ensureCategoriesIsMutable() { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -6815,7 +6996,7 @@ public com.google.protobuf.ProtocolStringList getCategoriesList() { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -6855,7 +7036,7 @@ public int getCategoriesCount() { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -6896,7 +7077,7 @@ public java.lang.String getCategories(int index) { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -6937,7 +7118,7 @@ public com.google.protobuf.ByteString getCategoriesBytes(int index) { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -6985,7 +7166,7 @@ public Builder setCategories(int index, java.lang.String value) { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -7032,7 +7213,7 @@ public Builder addCategories(java.lang.String value) { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -7076,7 +7257,7 @@ public Builder addAllCategories(java.lang.Iterable values) { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -7119,7 +7300,7 @@ public Builder clearCategories() { * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -13441,6 +13622,510 @@ public java.util.List getVariant return variantsBuilder_; } + private java.util.List localInventories_ = + java.util.Collections.emptyList(); + + private void ensureLocalInventoriesIsMutable() { + if (!((bitField0_ & 0x00002000) != 0)) { + localInventories_ = + new java.util.ArrayList( + localInventories_); + bitField0_ |= 0x00002000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.LocalInventory, + com.google.cloud.retail.v2beta.LocalInventory.Builder, + com.google.cloud.retail.v2beta.LocalInventoryOrBuilder> + localInventoriesBuilder_; + + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getLocalInventoriesList() { + if (localInventoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(localInventories_); + } else { + return localInventoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getLocalInventoriesCount() { + if (localInventoriesBuilder_ == null) { + return localInventories_.size(); + } else { + return localInventoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.LocalInventory getLocalInventories(int index) { + if (localInventoriesBuilder_ == null) { + return localInventories_.get(index); + } else { + return localInventoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setLocalInventories( + int index, com.google.cloud.retail.v2beta.LocalInventory value) { + if (localInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalInventoriesIsMutable(); + localInventories_.set(index, value); + onChanged(); + } else { + localInventoriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setLocalInventories( + int index, com.google.cloud.retail.v2beta.LocalInventory.Builder builderForValue) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.set(index, builderForValue.build()); + onChanged(); + } else { + localInventoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addLocalInventories(com.google.cloud.retail.v2beta.LocalInventory value) { + if (localInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalInventoriesIsMutable(); + localInventories_.add(value); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addLocalInventories( + int index, com.google.cloud.retail.v2beta.LocalInventory value) { + if (localInventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocalInventoriesIsMutable(); + localInventories_.add(index, value); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addLocalInventories( + com.google.cloud.retail.v2beta.LocalInventory.Builder builderForValue) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.add(builderForValue.build()); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addLocalInventories( + int index, com.google.cloud.retail.v2beta.LocalInventory.Builder builderForValue) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.add(index, builderForValue.build()); + onChanged(); + } else { + localInventoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllLocalInventories( + java.lang.Iterable values) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, localInventories_); + onChanged(); + } else { + localInventoriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearLocalInventories() { + if (localInventoriesBuilder_ == null) { + localInventories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + onChanged(); + } else { + localInventoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeLocalInventories(int index) { + if (localInventoriesBuilder_ == null) { + ensureLocalInventoriesIsMutable(); + localInventories_.remove(index); + onChanged(); + } else { + localInventoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.LocalInventory.Builder getLocalInventoriesBuilder( + int index) { + return getLocalInventoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.LocalInventoryOrBuilder getLocalInventoriesOrBuilder( + int index) { + if (localInventoriesBuilder_ == null) { + return localInventories_.get(index); + } else { + return localInventoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getLocalInventoriesOrBuilderList() { + if (localInventoriesBuilder_ != null) { + return localInventoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(localInventories_); + } + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.LocalInventory.Builder addLocalInventoriesBuilder() { + return getLocalInventoriesFieldBuilder() + .addBuilder(com.google.cloud.retail.v2beta.LocalInventory.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.retail.v2beta.LocalInventory.Builder addLocalInventoriesBuilder( + int index) { + return getLocalInventoriesFieldBuilder() + .addBuilder(index, com.google.cloud.retail.v2beta.LocalInventory.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A list of local inventories specific to different places.
+     * This is only available for users who have Retail Search enabled, and it can
+     * be managed by
+     * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+     * and
+     * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+     * APIs.
+     * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getLocalInventoriesBuilderList() { + return getLocalInventoriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.LocalInventory, + com.google.cloud.retail.v2beta.LocalInventory.Builder, + com.google.cloud.retail.v2beta.LocalInventoryOrBuilder> + getLocalInventoriesFieldBuilder() { + if (localInventoriesBuilder_ == null) { + localInventoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.retail.v2beta.LocalInventory, + com.google.cloud.retail.v2beta.LocalInventory.Builder, + com.google.cloud.retail.v2beta.LocalInventoryOrBuilder>( + localInventories_, + ((bitField0_ & 0x00002000) != 0), + getParentForChildren(), + isClean()); + localInventories_ = null; + } + return localInventoriesBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductOrBuilder.java index e05d550a5566..7eb5c6fa175c 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductOrBuilder.java @@ -355,7 +355,7 @@ public interface ProductOrBuilder * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -376,7 +376,7 @@ public interface ProductOrBuilder * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -397,7 +397,7 @@ public interface ProductOrBuilder * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -419,7 +419,7 @@ public interface ProductOrBuilder * The [type][google.cloud.retail.v2beta.Product.type] of the members must be * either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or * [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise - * and INVALID_ARGUMENT error is thrown. Should not set it for other types. A + * an INVALID_ARGUMENT error is thrown. Should not set it for other types. A * maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is * return. *
@@ -490,7 +490,7 @@ public interface ProductOrBuilder * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -528,7 +528,7 @@ public interface ProductOrBuilder * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -566,7 +566,7 @@ public interface ProductOrBuilder * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -605,7 +605,7 @@ public interface ProductOrBuilder * belonging to several parallel categories. Strongly recommended using the * full path for better search / recommendation quality. * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * For example, if a shoes product belongs to both * ["Shoes & Accessories" -> "Shoes"] and @@ -2282,5 +2282,97 @@ com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault( */ com.google.cloud.retail.v2beta.ProductOrBuilder getVariantsOrBuilder(int index); + /** + * + * + *
+   * Output only. A list of local inventories specific to different places.
+   * This is only available for users who have Retail Search enabled, and it can
+   * be managed by
+   * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+   * and
+   * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+   * APIs.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getLocalInventoriesList(); + /** + * + * + *
+   * Output only. A list of local inventories specific to different places.
+   * This is only available for users who have Retail Search enabled, and it can
+   * be managed by
+   * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+   * and
+   * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+   * APIs.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2beta.LocalInventory getLocalInventories(int index); + /** + * + * + *
+   * Output only. A list of local inventories specific to different places.
+   * This is only available for users who have Retail Search enabled, and it can
+   * be managed by
+   * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+   * and
+   * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+   * APIs.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getLocalInventoriesCount(); + /** + * + * + *
+   * Output only. A list of local inventories specific to different places.
+   * This is only available for users who have Retail Search enabled, and it can
+   * be managed by
+   * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+   * and
+   * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+   * APIs.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getLocalInventoriesOrBuilderList(); + /** + * + * + *
+   * Output only. A list of local inventories specific to different places.
+   * This is only available for users who have Retail Search enabled, and it can
+   * be managed by
+   * [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+   * and
+   * [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+   * APIs.
+   * 
+ * + * + * repeated .google.cloud.retail.v2beta.LocalInventory local_inventories = 35 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.retail.v2beta.LocalInventoryOrBuilder getLocalInventoriesOrBuilder(int index); + public com.google.cloud.retail.v2beta.Product.ExpirationCase getExpirationCase(); } diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductProto.java index f0a512f62022..88878cdd39d3 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductProto.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ProductProto.java @@ -52,7 +52,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "promotion.proto\032\036google/protobuf/duratio" + "n.proto\032 google/protobuf/field_mask.prot" + "o\032\037google/protobuf/timestamp.proto\032\036goog" - + "le/protobuf/wrappers.proto\"\277\r\n\007Product\0221" + + "le/protobuf/wrappers.proto\"\213\016\n\007Product\0221" + "\n\013expire_time\030\020 \001(\0132\032.google.protobuf.Ti" + "mestampH\000\022-\n\003ttl\030\021 \001(\0132\031.google.protobuf" + ".DurationB\003\340A\004H\000\022\021\n\004name\030\001 \001(\tB\003\340A\005\022\017\n\002i" @@ -85,26 +85,28 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "otobuf.Timestamp\0226\n\022retrievable_fields\030\036" + " \001(\0132\032.google.protobuf.FieldMask\022:\n\010vari" + "ants\030\037 \003(\0132#.google.cloud.retail.v2beta." - + "ProductB\003\340A\003\032^\n\017AttributesEntry\022\013\n\003key\030\001" - + " \001(\t\022:\n\005value\030\002 \001(\0132+.google.cloud.retai" - + "l.v2beta.CustomAttribute:\0028\001\"F\n\004Type\022\024\n\020" - + "TYPE_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020\001\022\013\n\007VARIA" - + "NT\020\002\022\016\n\nCOLLECTION\020\003\"i\n\014Availability\022\034\n\030" - + "AVAILABILITY_UNSPECIFIED\020\000\022\014\n\010IN_STOCK\020\001" - + "\022\020\n\014OUT_OF_STOCK\020\002\022\014\n\010PREORDER\020\003\022\r\n\tBACK" - + "ORDER\020\004:\204\001\352A\200\001\n\035retail.googleapis.com/Pr" - + "oduct\022_projects/{project}/locations/{loc" - + "ation}/catalogs/{catalog}/branches/{bran" - + "ch}/products/{product}B\014\n\nexpirationB\304\002\n" - + "\036com.google.cloud.retail.v2betaB\014Product" - + "ProtoP\001Z@google.golang.org/genproto/goog" - + "leapis/cloud/retail/v2beta;retail\242\002\006RETA" - + "IL\252\002\032Google.Cloud.Retail.V2Beta\312\002\032Google" - + "\\Cloud\\Retail\\V2beta\352\002\035Google::Cloud::Re" - + "tail::V2beta\352Al\n\034retail.googleapis.com/B" - + "ranch\022Lprojects/{project}/locations/{loc" - + "ation}/catalogs/{catalog}/branches/{bran" - + "ch}b\006proto3" + + "ProductB\003\340A\003\022J\n\021local_inventories\030# \003(\0132" + + "*.google.cloud.retail.v2beta.LocalInvent" + + "oryB\003\340A\003\032^\n\017AttributesEntry\022\013\n\003key\030\001 \001(\t" + + "\022:\n\005value\030\002 \001(\0132+.google.cloud.retail.v2" + + "beta.CustomAttribute:\0028\001\"F\n\004Type\022\024\n\020TYPE" + + "_UNSPECIFIED\020\000\022\013\n\007PRIMARY\020\001\022\013\n\007VARIANT\020\002" + + "\022\016\n\nCOLLECTION\020\003\"i\n\014Availability\022\034\n\030AVAI" + + "LABILITY_UNSPECIFIED\020\000\022\014\n\010IN_STOCK\020\001\022\020\n\014" + + "OUT_OF_STOCK\020\002\022\014\n\010PREORDER\020\003\022\r\n\tBACKORDE" + + "R\020\004:\204\001\352A\200\001\n\035retail.googleapis.com/Produc" + + "t\022_projects/{project}/locations/{locatio" + + "n}/catalogs/{catalog}/branches/{branch}/" + + "products/{product}B\014\n\nexpirationB\304\002\n\036com" + + ".google.cloud.retail.v2betaB\014ProductProt" + + "oP\001Z@google.golang.org/genproto/googleap" + + "is/cloud/retail/v2beta;retail\242\002\006RETAIL\252\002" + + "\032Google.Cloud.Retail.V2Beta\312\002\032Google\\Clo" + + "ud\\Retail\\V2beta\352\002\035Google::Cloud::Retail" + + "::V2beta\352Al\n\034retail.googleapis.com/Branc" + + "h\022Lprojects/{project}/locations/{locatio" + + "n}/catalogs/{catalog}/branches/{branch}b" + + "\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -158,6 +160,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PublishTime", "RetrievableFields", "Variants", + "LocalInventories", "Expiration", }); internal_static_google_cloud_retail_v2beta_Product_AttributesEntry_descriptor = diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadata.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadata.java index 52e8a15c1b33..81a1bb6ed405 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadata.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsMetadata.java @@ -22,7 +22,7 @@ * * *
- * Metadata for RejoinUserEvents method.
+ * Metadata for `RejoinUserEvents` method.
  * 
* * Protobuf type {@code google.cloud.retail.v2beta.RejoinUserEventsMetadata} @@ -259,7 +259,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Metadata for RejoinUserEvents method.
+   * Metadata for `RejoinUserEvents` method.
    * 
* * Protobuf type {@code google.cloud.retail.v2beta.RejoinUserEventsMetadata} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequest.java index f7170b6f40d2..b51e6b6ad281 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequest.java @@ -127,11 +127,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { *
    * The scope of user events to be rejoined with the latest product catalog.
    * If the rejoining aims at reducing number of unjoined events, set
-   * UserEventRejoinScope to UNJOINED_EVENTS.
+   * `UserEventRejoinScope` to `UNJOINED_EVENTS`.
    * If the rejoining aims at correcting product catalog information in joined
-   * events, set UserEventRejoinScope to JOINED_EVENTS.
-   * If all events needs to be rejoined, set UserEventRejoinScope to
-   * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED.
+   * events, set `UserEventRejoinScope` to `JOINED_EVENTS`.
+   * If all events needs to be rejoined, set `UserEventRejoinScope` to
+   * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED`.
    * 
* * Protobuf enum {@code google.cloud.retail.v2beta.RejoinUserEventsRequest.UserEventRejoinScope} @@ -350,8 +350,8 @@ public com.google.protobuf.ByteString getParentBytes() { *
    * The type of the user event rejoin to define the scope and range of the user
    * events to be rejoined with the latest product catalog. Defaults to
-   * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an
-   * invalid integer value.
+   * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to
+   * an invalid integer value.
    * 
* * @@ -370,8 +370,8 @@ public int getUserEventRejoinScopeValue() { *
    * The type of the user event rejoin to define the scope and range of the user
    * events to be rejoined with the latest product catalog. Defaults to
-   * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an
-   * invalid integer value.
+   * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to
+   * an invalid integer value.
    * 
* * @@ -850,8 +850,8 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { *
      * The type of the user event rejoin to define the scope and range of the user
      * events to be rejoined with the latest product catalog. Defaults to
-     * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an
-     * invalid integer value.
+     * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to
+     * an invalid integer value.
      * 
* * @@ -870,8 +870,8 @@ public int getUserEventRejoinScopeValue() { *
      * The type of the user event rejoin to define the scope and range of the user
      * events to be rejoined with the latest product catalog. Defaults to
-     * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an
-     * invalid integer value.
+     * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to
+     * an invalid integer value.
      * 
* * @@ -893,8 +893,8 @@ public Builder setUserEventRejoinScopeValue(int value) { *
      * The type of the user event rejoin to define the scope and range of the user
      * events to be rejoined with the latest product catalog. Defaults to
-     * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an
-     * invalid integer value.
+     * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to
+     * an invalid integer value.
      * 
* * @@ -920,8 +920,8 @@ public Builder setUserEventRejoinScopeValue(int value) { *
      * The type of the user event rejoin to define the scope and range of the user
      * events to be rejoined with the latest product catalog. Defaults to
-     * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an
-     * invalid integer value.
+     * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to
+     * an invalid integer value.
      * 
* * @@ -947,8 +947,8 @@ public Builder setUserEventRejoinScope( *
      * The type of the user event rejoin to define the scope and range of the user
      * events to be rejoined with the latest product catalog. Defaults to
-     * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an
-     * invalid integer value.
+     * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to
+     * an invalid integer value.
      * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequestOrBuilder.java index a130669c47b1..004389a69eba 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsRequestOrBuilder.java @@ -56,8 +56,8 @@ public interface RejoinUserEventsRequestOrBuilder *
    * The type of the user event rejoin to define the scope and range of the user
    * events to be rejoined with the latest product catalog. Defaults to
-   * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an
-   * invalid integer value.
+   * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to
+   * an invalid integer value.
    * 
* * @@ -73,8 +73,8 @@ public interface RejoinUserEventsRequestOrBuilder *
    * The type of the user event rejoin to define the scope and range of the user
    * events to be rejoined with the latest product catalog. Defaults to
-   * USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an
-   * invalid integer value.
+   * `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to
+   * an invalid integer value.
    * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponse.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponse.java index 4267ed3c4413..55b0a4961a99 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponse.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RejoinUserEventsResponse.java @@ -22,7 +22,7 @@ * * *
- * Response message for RejoinUserEvents method.
+ * Response message for `RejoinUserEvents` method.
  * 
* * Protobuf type {@code google.cloud.retail.v2beta.RejoinUserEventsResponse} @@ -291,7 +291,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * Response message for RejoinUserEvents method.
+   * Response message for `RejoinUserEvents` method.
    * 
* * Protobuf type {@code google.cloud.retail.v2beta.RejoinUserEventsResponse} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequest.java index 3f477160c65c..b43bb9acbded 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequest.java @@ -128,7 +128,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * *
    * Required. The source ServingConfig resource name . Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -154,7 +154,7 @@ public java.lang.String getServingConfig() { * *
    * Required. The source ServingConfig resource name . Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -567,7 +567,7 @@ public Builder mergeFrom( * *
      * Required. The source ServingConfig resource name . Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -592,7 +592,7 @@ public java.lang.String getServingConfig() { * *
      * Required. The source ServingConfig resource name . Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -617,7 +617,7 @@ public com.google.protobuf.ByteString getServingConfigBytes() { * *
      * Required. The source ServingConfig resource name . Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -641,7 +641,7 @@ public Builder setServingConfig(java.lang.String value) { * *
      * Required. The source ServingConfig resource name . Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * @@ -661,7 +661,7 @@ public Builder clearServingConfig() { * *
      * Required. The source ServingConfig resource name . Format:
-     * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
      * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequestOrBuilder.java index 524f449b98ad..635516dc77e2 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/RemoveControlRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface RemoveControlRequestOrBuilder * *
    * Required. The source ServingConfig resource name . Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * @@ -43,7 +43,7 @@ public interface RemoveControlRequestOrBuilder * *
    * Required. The source ServingConfig resource name . Format:
-   * projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
    * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ResumeModelRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ResumeModelRequest.java new file mode 100644 index 000000000000..8010ff6f1d57 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ResumeModelRequest.java @@ -0,0 +1,652 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for resuming training of a model.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ResumeModelRequest} + */ +public final class ResumeModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.ResumeModelRequest) + ResumeModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ResumeModelRequest.newBuilder() to construct. + private ResumeModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ResumeModelRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ResumeModelRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ResumeModelRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ResumeModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ResumeModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ResumeModelRequest.class, + com.google.cloud.retail.v2beta.ResumeModelRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the model to resume.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the model to resume.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.ResumeModelRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.ResumeModelRequest other = + (com.google.cloud.retail.v2beta.ResumeModelRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.ResumeModelRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ResumeModelRequest 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.ResumeModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ResumeModelRequest 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.ResumeModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.ResumeModelRequest 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.ResumeModelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ResumeModelRequest 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.ResumeModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.ResumeModelRequest 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.ResumeModelRequest 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.ResumeModelRequest 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.ResumeModelRequest 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 for resuming training of a model.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.ResumeModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.ResumeModelRequest) + com.google.cloud.retail.v2beta.ResumeModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ResumeModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ResumeModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.ResumeModelRequest.class, + com.google.cloud.retail.v2beta.ResumeModelRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.ResumeModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_ResumeModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ResumeModelRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.ResumeModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ResumeModelRequest build() { + com.google.cloud.retail.v2beta.ResumeModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.ResumeModelRequest buildPartial() { + com.google.cloud.retail.v2beta.ResumeModelRequest result = + new com.google.cloud.retail.v2beta.ResumeModelRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @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.ResumeModelRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.ResumeModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.ResumeModelRequest other) { + if (other == com.google.cloud.retail.v2beta.ResumeModelRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.ResumeModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.ResumeModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the model to resume.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the model to resume.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the model to resume.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the model to resume.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the model to resume.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + 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.ResumeModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.ResumeModelRequest) + private static final com.google.cloud.retail.v2beta.ResumeModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.ResumeModelRequest(); + } + + public static com.google.cloud.retail.v2beta.ResumeModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResumeModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResumeModelRequest(input, extensionRegistry); + } + }; + + 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.ResumeModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ResumeModelRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ResumeModelRequestOrBuilder.java new file mode 100644 index 000000000000..5fc1df558cbd --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ResumeModelRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public interface ResumeModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.ResumeModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the model to resume.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the model to resume.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rule.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rule.java index 5108a408cd46..095d156363a1 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rule.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/Rule.java @@ -25,8 +25,9 @@ * A rule is a condition-action pair * * A condition defines when a rule is to be triggered. * * An action specifies what occurs on that trigger. - * Currently only boost rules are supported. - * Currently only supported by the search endpoint. + * Currently rules only work for [controls][google.cloud.retail.v2beta.Control] + * with + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH]. * * * Protobuf type {@code google.cloud.retail.v2beta.Rule} @@ -9344,8 +9345,9 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * A rule is a condition-action pair * * A condition defines when a rule is to be triggered. * * An action specifies what occurs on that trigger. - * Currently only boost rules are supported. - * Currently only supported by the search endpoint. + * Currently rules only work for [controls][google.cloud.retail.v2beta.Control] + * with + * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH]. * * * Protobuf type {@code google.cloud.retail.v2beta.Rule} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequest.java index 7c955a31dcb2..1a530a8b4e51 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequest.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequest.java @@ -380,8 +380,11 @@ public enum SearchMode implements com.google.protobuf.ProtocolMessageEnum { * *
      * Default value. In this case both product search and faceted search will
-     * be performed. Both [SearchResponse.SearchResult] and
-     * [SearchResponse.Facet] will be returned.
+     * be performed. Both
+     * [SearchResponse.SearchResult][google.cloud.retail.v2beta.SearchResponse.SearchResult]
+     * and
+     * [SearchResponse.Facet][google.cloud.retail.v2beta.SearchResponse.Facet]
+     * will be returned.
      * 
* * SEARCH_MODE_UNSPECIFIED = 0; @@ -393,8 +396,11 @@ public enum SearchMode implements com.google.protobuf.ProtocolMessageEnum { *
      * Only product search will be performed. The faceted search will be
      * disabled.
-     * Only [SearchResponse.SearchResult] will be returned.
-     * [SearchResponse.Facet] will not be returned, even if
+     * Only
+     * [SearchResponse.SearchResult][google.cloud.retail.v2beta.SearchResponse.SearchResult]
+     * will be returned.
+     * [SearchResponse.Facet][google.cloud.retail.v2beta.SearchResponse.Facet]
+     * will not be returned, even if
      * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
      * or
      * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec]
@@ -415,7 +421,9 @@ public enum SearchMode implements com.google.protobuf.ProtocolMessageEnum {
      * and
      * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec]
      * should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only
-     * [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult]
+     * [SearchResponse.Facet][google.cloud.retail.v2beta.SearchResponse.Facet]
+     * will be returned.
+     * [SearchResponse.SearchResult][google.cloud.retail.v2beta.SearchResponse.SearchResult]
      * will not be returned.
      * 
* @@ -430,8 +438,11 @@ public enum SearchMode implements com.google.protobuf.ProtocolMessageEnum { * *
      * Default value. In this case both product search and faceted search will
-     * be performed. Both [SearchResponse.SearchResult] and
-     * [SearchResponse.Facet] will be returned.
+     * be performed. Both
+     * [SearchResponse.SearchResult][google.cloud.retail.v2beta.SearchResponse.SearchResult]
+     * and
+     * [SearchResponse.Facet][google.cloud.retail.v2beta.SearchResponse.Facet]
+     * will be returned.
      * 
* * SEARCH_MODE_UNSPECIFIED = 0; @@ -443,8 +454,11 @@ public enum SearchMode implements com.google.protobuf.ProtocolMessageEnum { *
      * Only product search will be performed. The faceted search will be
      * disabled.
-     * Only [SearchResponse.SearchResult] will be returned.
-     * [SearchResponse.Facet] will not be returned, even if
+     * Only
+     * [SearchResponse.SearchResult][google.cloud.retail.v2beta.SearchResponse.SearchResult]
+     * will be returned.
+     * [SearchResponse.Facet][google.cloud.retail.v2beta.SearchResponse.Facet]
+     * will not be returned, even if
      * [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
      * or
      * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec]
@@ -465,7 +479,9 @@ public enum SearchMode implements com.google.protobuf.ProtocolMessageEnum {
      * and
      * [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec]
      * should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only
-     * [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult]
+     * [SearchResponse.Facet][google.cloud.retail.v2beta.SearchResponse.Facet]
+     * will be returned.
+     * [SearchResponse.SearchResult][google.cloud.retail.v2beta.SearchResponse.SearchResult]
      * will not be returned.
      * 
* @@ -9606,7 +9622,8 @@ public enum Condition implements com.google.protobuf.ProtocolMessageEnum { * * *
-       * Unspecified query expansion condition. This defaults to
+       * Unspecified query expansion condition. In this case, server behavior
+       * defaults to
        * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
        * 
* @@ -9642,7 +9659,8 @@ public enum Condition implements com.google.protobuf.ProtocolMessageEnum { * * *
-       * Unspecified query expansion condition. This defaults to
+       * Unspecified query expansion condition. In this case, server behavior
+       * defaults to
        * [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
        * 
* @@ -10542,7 +10560,8 @@ public enum Mode implements com.google.protobuf.ProtocolMessageEnum { * * *
-       * Let CRS decide whether to use personalization.
+       * Let CRS decide whether to use personalization based on quality of user
+       * event data.
        * 
* * AUTO = 1; @@ -10576,7 +10595,8 @@ public enum Mode implements com.google.protobuf.ProtocolMessageEnum { * * *
-       * Let CRS decide whether to use personalization.
+       * Let CRS decide whether to use personalization based on quality of user
+       * event data.
        * 
* * AUTO = 1; @@ -12714,7 +12734,7 @@ public com.google.cloud.retail.v2beta.SearchRequest.FacetSpecOrBuilder getFacetS *
* * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See - * google/cloud/retail/v2beta/search_service.proto;l=576 + * google/cloud/retail/v2beta/search_service.proto;l=586 * @return Whether the dynamicFacetSpec field is set. */ @java.lang.Override @@ -12737,7 +12757,7 @@ public boolean hasDynamicFacetSpec() { *
* * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See - * google/cloud/retail/v2beta/search_service.proto;l=576 + * google/cloud/retail/v2beta/search_service.proto;l=586 * @return The dynamicFacetSpec. */ @java.lang.Override @@ -13230,7 +13250,7 @@ public com.google.protobuf.ByteString getVariantRollupKeysBytes(int index) { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -13253,7 +13273,7 @@ public com.google.protobuf.ProtocolStringList getPageCategoriesList() { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -13276,7 +13296,7 @@ public int getPageCategoriesCount() { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -13300,7 +13320,7 @@ public java.lang.String getPageCategories(int index) { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -13363,6 +13383,14 @@ public com.google.cloud.retail.v2beta.SearchRequest.SearchMode getSearchMode() { * *
    * The specification for personalization.
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
    * 
* * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; @@ -13379,6 +13407,14 @@ public boolean hasPersonalizationSpec() { * *
    * The specification for personalization.
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
    * 
* * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; @@ -13397,6 +13433,14 @@ public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec getPerso * *
    * The specification for personalization.
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
    * 
* * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; @@ -16245,7 +16289,7 @@ public com.google.cloud.retail.v2beta.SearchRequest.FacetSpec.Builder addFacetSp * * * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See - * google/cloud/retail/v2beta/search_service.proto;l=576 + * google/cloud/retail/v2beta/search_service.proto;l=586 * @return Whether the dynamicFacetSpec field is set. */ @java.lang.Deprecated @@ -16267,7 +16311,7 @@ public boolean hasDynamicFacetSpec() { *
* * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See - * google/cloud/retail/v2beta/search_service.proto;l=576 + * google/cloud/retail/v2beta/search_service.proto;l=586 * @return The dynamicFacetSpec. */ @java.lang.Deprecated @@ -17719,7 +17763,7 @@ private void ensurePageCategoriesIsMutable() { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -17742,7 +17786,7 @@ public com.google.protobuf.ProtocolStringList getPageCategoriesList() { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -17765,7 +17809,7 @@ public int getPageCategoriesCount() { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -17789,7 +17833,7 @@ public java.lang.String getPageCategories(int index) { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -17813,7 +17857,7 @@ public com.google.protobuf.ByteString getPageCategoriesBytes(int index) { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -17844,7 +17888,7 @@ public Builder setPageCategories(int index, java.lang.String value) { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -17874,7 +17918,7 @@ public Builder addPageCategories(java.lang.String value) { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -17901,7 +17945,7 @@ public Builder addAllPageCategories(java.lang.Iterable values) * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -17927,7 +17971,7 @@ public Builder clearPageCategories() { * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -18059,6 +18103,14 @@ public Builder clearSearchMode() { * *
      * The specification for personalization.
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
      * 
* * @@ -18075,6 +18127,14 @@ public boolean hasPersonalizationSpec() { * *
      * The specification for personalization.
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
      * 
* * @@ -18098,6 +18158,14 @@ public boolean hasPersonalizationSpec() { * *
      * The specification for personalization.
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
      * 
* * @@ -18123,6 +18191,14 @@ public Builder setPersonalizationSpec( * *
      * The specification for personalization.
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
      * 
* * @@ -18145,6 +18221,14 @@ public Builder setPersonalizationSpec( * *
      * The specification for personalization.
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
      * 
* * @@ -18175,6 +18259,14 @@ public Builder mergePersonalizationSpec( * *
      * The specification for personalization.
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
      * 
* * @@ -18197,6 +18289,14 @@ public Builder clearPersonalizationSpec() { * *
      * The specification for personalization.
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
      * 
* * @@ -18214,6 +18314,14 @@ public Builder clearPersonalizationSpec() { * *
      * The specification for personalization.
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
      * 
* * @@ -18235,6 +18343,14 @@ public Builder clearPersonalizationSpec() { * *
      * The specification for personalization.
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
      * 
* * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequestOrBuilder.java index 3b53a971ec35..4cf93287a4ed 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequestOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchRequestOrBuilder.java @@ -459,7 +459,7 @@ public interface SearchRequestOrBuilder * * * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See - * google/cloud/retail/v2beta/search_service.proto;l=576 + * google/cloud/retail/v2beta/search_service.proto;l=586 * @return Whether the dynamicFacetSpec field is set. */ @java.lang.Deprecated @@ -479,7 +479,7 @@ public interface SearchRequestOrBuilder *
* * @deprecated google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec is deprecated. See - * google/cloud/retail/v2beta/search_service.proto;l=576 + * google/cloud/retail/v2beta/search_service.proto;l=586 * @return The dynamicFacetSpec. */ @java.lang.Deprecated @@ -926,7 +926,7 @@ public interface SearchRequestOrBuilder * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -947,7 +947,7 @@ public interface SearchRequestOrBuilder * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -968,7 +968,7 @@ public interface SearchRequestOrBuilder * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -990,7 +990,7 @@ public interface SearchRequestOrBuilder * the same as * [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories]; * To represent full path of category, use '>' sign to separate different - * hierarchies. If '>' is part of the category name, please replace it with + * hierarchies. If '>' is part of the category name, replace it with * other character(s). * Category pages include special pages such as sales or promotions. For * instance, a special sale page may have the category hierarchy: @@ -1036,6 +1036,14 @@ public interface SearchRequestOrBuilder * *
    * The specification for personalization.
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
    * 
* * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; @@ -1049,6 +1057,14 @@ public interface SearchRequestOrBuilder * *
    * The specification for personalization.
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
    * 
* * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; @@ -1062,6 +1078,14 @@ public interface SearchRequestOrBuilder * *
    * The specification for personalization.
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
    * 
* * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 32; diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponse.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponse.java index c3b555c57955..f0df3b3b3c9e 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponse.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchResponse.java @@ -650,6 +650,93 @@ com.google.protobuf.Value getVariantRollupValuesOrDefault( * map<string, .google.protobuf.Value> variant_rollup_values = 5; */ com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String key); + + /** + * + * + *
+     * Specifies previous events related to this product for this user based on
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+     * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+     * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+     * This is set only when
+     * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+     * is
+     * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * Possible values:
+     * * `purchased`: Indicates that this product has been purchased before.
+     * 
+ * + * repeated string personal_labels = 7; + * + * @return A list containing the personalLabels. + */ + java.util.List getPersonalLabelsList(); + /** + * + * + *
+     * Specifies previous events related to this product for this user based on
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+     * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+     * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+     * This is set only when
+     * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+     * is
+     * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * Possible values:
+     * * `purchased`: Indicates that this product has been purchased before.
+     * 
+ * + * repeated string personal_labels = 7; + * + * @return The count of personalLabels. + */ + int getPersonalLabelsCount(); + /** + * + * + *
+     * Specifies previous events related to this product for this user based on
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+     * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+     * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+     * This is set only when
+     * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+     * is
+     * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * Possible values:
+     * * `purchased`: Indicates that this product has been purchased before.
+     * 
+ * + * repeated string personal_labels = 7; + * + * @param index The index of the element to return. + * @return The personalLabels at the given index. + */ + java.lang.String getPersonalLabels(int index); + /** + * + * + *
+     * Specifies previous events related to this product for this user based on
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+     * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+     * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+     * This is set only when
+     * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+     * is
+     * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * Possible values:
+     * * `purchased`: Indicates that this product has been purchased before.
+     * 
+ * + * repeated string personal_labels = 7; + * + * @param index The index of the value to return. + * @return The bytes of the personalLabels at the given index. + */ + com.google.protobuf.ByteString getPersonalLabelsBytes(int index); } /** * @@ -672,6 +759,7 @@ private SearchResult(com.google.protobuf.GeneratedMessageV3.Builder builder) private SearchResult() { id_ = ""; + personalLabels_ = com.google.protobuf.LazyStringArrayList.EMPTY; } @java.lang.Override @@ -768,6 +856,16 @@ private SearchResult( .put(variantRollupValues__.getKey(), variantRollupValues__.getValue()); break; } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + personalLabels_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + personalLabels_.add(s); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -784,6 +882,9 @@ private SearchResult( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000004) != 0)) { + personalLabels_ = personalLabels_.getUnmodifiableView(); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -1331,6 +1432,103 @@ public com.google.protobuf.Value getVariantRollupValuesOrThrow(java.lang.String return map.get(key); } + public static final int PERSONAL_LABELS_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList personalLabels_; + /** + * + * + *
+     * Specifies previous events related to this product for this user based on
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+     * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+     * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+     * This is set only when
+     * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+     * is
+     * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * Possible values:
+     * * `purchased`: Indicates that this product has been purchased before.
+     * 
+ * + * repeated string personal_labels = 7; + * + * @return A list containing the personalLabels. + */ + public com.google.protobuf.ProtocolStringList getPersonalLabelsList() { + return personalLabels_; + } + /** + * + * + *
+     * Specifies previous events related to this product for this user based on
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+     * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+     * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+     * This is set only when
+     * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+     * is
+     * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * Possible values:
+     * * `purchased`: Indicates that this product has been purchased before.
+     * 
+ * + * repeated string personal_labels = 7; + * + * @return The count of personalLabels. + */ + public int getPersonalLabelsCount() { + return personalLabels_.size(); + } + /** + * + * + *
+     * Specifies previous events related to this product for this user based on
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+     * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+     * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+     * This is set only when
+     * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+     * is
+     * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * Possible values:
+     * * `purchased`: Indicates that this product has been purchased before.
+     * 
+ * + * repeated string personal_labels = 7; + * + * @param index The index of the element to return. + * @return The personalLabels at the given index. + */ + public java.lang.String getPersonalLabels(int index) { + return personalLabels_.get(index); + } + /** + * + * + *
+     * Specifies previous events related to this product for this user based on
+     * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+     * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+     * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+     * This is set only when
+     * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+     * is
+     * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+     * Possible values:
+     * * `purchased`: Indicates that this product has been purchased before.
+     * 
+ * + * repeated string personal_labels = 7; + * + * @param index The index of the value to return. + * @return The bytes of the personalLabels at the given index. + */ + public com.google.protobuf.ByteString getPersonalLabelsBytes(int index) { + return personalLabels_.getByteString(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -1364,6 +1562,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io internalGetVariantRollupValues(), VariantRollupValuesDefaultEntryHolder.defaultEntry, 5); + for (int i = 0; i < personalLabels_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, personalLabels_.getRaw(i)); + } unknownFields.writeTo(output); } @@ -1405,6 +1606,14 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, variantRollupValues__); } + { + int dataSize = 0; + for (int i = 0; i < personalLabels_.size(); i++) { + dataSize += computeStringSizeNoTag(personalLabels_.getRaw(i)); + } + size += dataSize; + size += 1 * getPersonalLabelsList().size(); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1431,6 +1640,7 @@ public boolean equals(final java.lang.Object obj) { return false; if (!internalGetVariantRollupValues().equals(other.internalGetVariantRollupValues())) return false; + if (!getPersonalLabelsList().equals(other.getPersonalLabelsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -1458,6 +1668,10 @@ public int hashCode() { hash = (37 * hash) + VARIANT_ROLLUP_VALUES_FIELD_NUMBER; hash = (53 * hash) + internalGetVariantRollupValues().hashCode(); } + if (getPersonalLabelsCount() > 0) { + hash = (37 * hash) + PERSONAL_LABELS_FIELD_NUMBER; + hash = (53 * hash) + getPersonalLabelsList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1642,6 +1856,8 @@ public Builder clear() { internalGetMutableMatchingVariantFields().clear(); internalGetMutableVariantRollupValues().clear(); + personalLabels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -1682,6 +1898,11 @@ public com.google.cloud.retail.v2beta.SearchResponse.SearchResult buildPartial() result.matchingVariantFields_.makeImmutable(); result.variantRollupValues_ = internalGetVariantRollupValues(); result.variantRollupValues_.makeImmutable(); + if (((bitField0_ & 0x00000004) != 0)) { + personalLabels_ = personalLabels_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.personalLabels_ = personalLabels_; onBuilt(); return result; } @@ -1748,6 +1969,16 @@ public Builder mergeFrom(com.google.cloud.retail.v2beta.SearchResponse.SearchRes internalGetMutableMatchingVariantFields() .mergeFrom(other.internalGetMatchingVariantFields()); internalGetMutableVariantRollupValues().mergeFrom(other.internalGetVariantRollupValues()); + if (!other.personalLabels_.isEmpty()) { + if (personalLabels_.isEmpty()) { + personalLabels_ = other.personalLabels_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePersonalLabelsIsMutable(); + personalLabels_.addAll(other.personalLabels_); + } + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -2830,6 +3061,255 @@ public Builder putAllVariantRollupValues( return this; } + private com.google.protobuf.LazyStringList personalLabels_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensurePersonalLabelsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + personalLabels_ = new com.google.protobuf.LazyStringArrayList(personalLabels_); + bitField0_ |= 0x00000004; + } + } + /** + * + * + *
+       * Specifies previous events related to this product for this user based on
+       * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+       * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+       * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+       * This is set only when
+       * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+       * is
+       * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * Possible values:
+       * * `purchased`: Indicates that this product has been purchased before.
+       * 
+ * + * repeated string personal_labels = 7; + * + * @return A list containing the personalLabels. + */ + public com.google.protobuf.ProtocolStringList getPersonalLabelsList() { + return personalLabels_.getUnmodifiableView(); + } + /** + * + * + *
+       * Specifies previous events related to this product for this user based on
+       * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+       * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+       * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+       * This is set only when
+       * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+       * is
+       * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * Possible values:
+       * * `purchased`: Indicates that this product has been purchased before.
+       * 
+ * + * repeated string personal_labels = 7; + * + * @return The count of personalLabels. + */ + public int getPersonalLabelsCount() { + return personalLabels_.size(); + } + /** + * + * + *
+       * Specifies previous events related to this product for this user based on
+       * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+       * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+       * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+       * This is set only when
+       * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+       * is
+       * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * Possible values:
+       * * `purchased`: Indicates that this product has been purchased before.
+       * 
+ * + * repeated string personal_labels = 7; + * + * @param index The index of the element to return. + * @return The personalLabels at the given index. + */ + public java.lang.String getPersonalLabels(int index) { + return personalLabels_.get(index); + } + /** + * + * + *
+       * Specifies previous events related to this product for this user based on
+       * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+       * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+       * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+       * This is set only when
+       * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+       * is
+       * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * Possible values:
+       * * `purchased`: Indicates that this product has been purchased before.
+       * 
+ * + * repeated string personal_labels = 7; + * + * @param index The index of the value to return. + * @return The bytes of the personalLabels at the given index. + */ + public com.google.protobuf.ByteString getPersonalLabelsBytes(int index) { + return personalLabels_.getByteString(index); + } + /** + * + * + *
+       * Specifies previous events related to this product for this user based on
+       * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+       * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+       * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+       * This is set only when
+       * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+       * is
+       * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * Possible values:
+       * * `purchased`: Indicates that this product has been purchased before.
+       * 
+ * + * repeated string personal_labels = 7; + * + * @param index The index to set the value at. + * @param value The personalLabels to set. + * @return This builder for chaining. + */ + public Builder setPersonalLabels(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePersonalLabelsIsMutable(); + personalLabels_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies previous events related to this product for this user based on
+       * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+       * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+       * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+       * This is set only when
+       * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+       * is
+       * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * Possible values:
+       * * `purchased`: Indicates that this product has been purchased before.
+       * 
+ * + * repeated string personal_labels = 7; + * + * @param value The personalLabels to add. + * @return This builder for chaining. + */ + public Builder addPersonalLabels(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensurePersonalLabelsIsMutable(); + personalLabels_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies previous events related to this product for this user based on
+       * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+       * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+       * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+       * This is set only when
+       * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+       * is
+       * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * Possible values:
+       * * `purchased`: Indicates that this product has been purchased before.
+       * 
+ * + * repeated string personal_labels = 7; + * + * @param values The personalLabels to add. + * @return This builder for chaining. + */ + public Builder addAllPersonalLabels(java.lang.Iterable values) { + ensurePersonalLabelsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, personalLabels_); + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies previous events related to this product for this user based on
+       * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+       * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+       * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+       * This is set only when
+       * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+       * is
+       * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * Possible values:
+       * * `purchased`: Indicates that this product has been purchased before.
+       * 
+ * + * repeated string personal_labels = 7; + * + * @return This builder for chaining. + */ + public Builder clearPersonalLabels() { + personalLabels_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * Specifies previous events related to this product for this user based on
+       * [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+       * [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+       * or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+       * This is set only when
+       * [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+       * is
+       * [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+       * Possible values:
+       * * `purchased`: Indicates that this product has been purchased before.
+       * 
+ * + * repeated string personal_labels = 7; + * + * @param value The bytes of the personalLabels to add. + * @return This builder for chaining. + */ + public Builder addPersonalLabelsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensurePersonalLabelsIsMutable(); + personalLabels_.add(value); + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceProto.java index 5b9547a4bddb..471788fcfead 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceProto.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchServiceProto.java @@ -176,7 +176,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\t:\0028\001\"[\n\nSearchMode\022\033\n\027SEARCH_MODE_UNSPE" + "CIFIED\020\000\022\027\n\023PRODUCT_SEARCH_ONLY\020\001\022\027\n\023FAC" + "ETED_SEARCH_ONLY\020\002B\030\n\026_spell_correction_" - + "spec\"\344\n\n\016SearchResponse\022H\n\007results\030\001 \003(\013" + + "spec\"\375\n\n\016SearchResponse\022H\n\007results\030\001 \003(\013" + "27.google.cloud.retail.v2beta.SearchResp" + "onse.SearchResult\022@\n\006facets\030\002 \003(\01320.goog" + "le.cloud.retail.v2beta.SearchResponse.Fa" @@ -188,7 +188,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "irect_uri\030\n \001(\t\022\030\n\020applied_controls\030\014 \003(" + "\t\022m\n\035invalid_condition_boost_specs\030\016 \003(\013" + "2F.google.cloud.retail.v2beta.SearchRequ" - + "est.BoostSpec.ConditionBoostSpec\032\204\004\n\014Sea" + + "est.BoostSpec.ConditionBoostSpec\032\235\004\n\014Sea" + "rchResult\022\n\n\002id\030\001 \001(\t\0224\n\007product\030\002 \001(\0132#" + ".google.cloud.retail.v2beta.Product\022\036\n\026m" + "atching_variant_count\030\003 \001(\005\022s\n\027matching_" @@ -197,35 +197,36 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "tchingVariantFieldsEntry\022o\n\025variant_roll" + "up_values\030\005 \003(\0132P.google.cloud.retail.v2" + "beta.SearchResponse.SearchResult.Variant" - + "RollupValuesEntry\032X\n\032MatchingVariantFiel" - + "dsEntry\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 \001(\0132\032.go" - + "ogle.protobuf.FieldMask:\0028\001\032R\n\030VariantRo" - + "llupValuesEntry\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 " - + "\001(\0132\026.google.protobuf.Value:\0028\001\032\226\002\n\005Face" - + "t\022\013\n\003key\030\001 \001(\t\022K\n\006values\030\002 \003(\0132;.google." - + "cloud.retail.v2beta.SearchResponse.Facet" - + ".FacetValue\022\025\n\rdynamic_facet\030\003 \001(\010\032\233\001\n\nF" - + "acetValue\022\017\n\005value\030\001 \001(\tH\000\0228\n\010interval\030\002" - + " \001(\0132$.google.cloud.retail.v2beta.Interv" - + "alH\000\022\r\n\005count\030\003 \001(\003\022\021\n\tmin_value\030\005 \001(\001\022\021" - + "\n\tmax_value\030\006 \001(\001B\r\n\013facet_value\032I\n\022Quer" - + "yExpansionInfo\022\026\n\016expanded_query\030\001 \001(\010\022\033" - + "\n\023pinned_result_count\030\002 \001(\0032\350\002\n\rSearchSe" - + "rvice\022\213\002\n\006Search\022).google.cloud.retail.v" - + "2beta.SearchRequest\032*.google.cloud.retai" - + "l.v2beta.SearchResponse\"\251\001\202\323\344\223\002\242\001\"I/v2be" - + "ta/{placement=projects/*/locations/*/cat" - + "alogs/*/placements/*}:search:\001*ZR\"M/v2be" - + "ta/{placement=projects/*/locations/*/cat" - + "alogs/*/servingConfigs/*}:search:\001*\032I\312A\025" - + "retail.googleapis.com\322A.https://www.goog" - + "leapis.com/auth/cloud-platformB\333\001\n\036com.g" - + "oogle.cloud.retail.v2betaB\022SearchService" - + "ProtoP\001Z@google.golang.org/genproto/goog" - + "leapis/cloud/retail/v2beta;retail\242\002\006RETA" - + "IL\252\002\032Google.Cloud.Retail.V2Beta\312\002\032Google" - + "\\Cloud\\Retail\\V2beta\352\002\035Google::Cloud::Re" - + "tail::V2betab\006proto3" + + "RollupValuesEntry\022\027\n\017personal_labels\030\007 \003" + + "(\t\032X\n\032MatchingVariantFieldsEntry\022\013\n\003key\030" + + "\001 \001(\t\022)\n\005value\030\002 \001(\0132\032.google.protobuf.F" + + "ieldMask:\0028\001\032R\n\030VariantRollupValuesEntry" + + "\022\013\n\003key\030\001 \001(\t\022%\n\005value\030\002 \001(\0132\026.google.pr" + + "otobuf.Value:\0028\001\032\226\002\n\005Facet\022\013\n\003key\030\001 \001(\t\022" + + "K\n\006values\030\002 \003(\0132;.google.cloud.retail.v2" + + "beta.SearchResponse.Facet.FacetValue\022\025\n\r" + + "dynamic_facet\030\003 \001(\010\032\233\001\n\nFacetValue\022\017\n\005va" + + "lue\030\001 \001(\tH\000\0228\n\010interval\030\002 \001(\0132$.google.c" + + "loud.retail.v2beta.IntervalH\000\022\r\n\005count\030\003" + + " \001(\003\022\021\n\tmin_value\030\005 \001(\001\022\021\n\tmax_value\030\006 \001" + + "(\001B\r\n\013facet_value\032I\n\022QueryExpansionInfo\022" + + "\026\n\016expanded_query\030\001 \001(\010\022\033\n\023pinned_result" + + "_count\030\002 \001(\0032\350\002\n\rSearchService\022\213\002\n\006Searc" + + "h\022).google.cloud.retail.v2beta.SearchReq" + + "uest\032*.google.cloud.retail.v2beta.Search" + + "Response\"\251\001\202\323\344\223\002\242\001\"I/v2beta/{placement=p" + + "rojects/*/locations/*/catalogs/*/placeme" + + "nts/*}:search:\001*ZR\"M/v2beta/{placement=p" + + "rojects/*/locations/*/catalogs/*/serving" + + "Configs/*}:search:\001*\032I\312A\025retail.googleap" + + "is.com\322A.https://www.googleapis.com/auth" + + "/cloud-platformB\333\001\n\036com.google.cloud.ret" + + "ail.v2betaB\022SearchServiceProtoP\001Z@google" + + ".golang.org/genproto/googleapis/cloud/re" + + "tail/v2beta;retail\242\002\006RETAIL\252\002\032Google.Clo" + + "ud.Retail.V2Beta\312\002\032Google\\Cloud\\Retail\\V" + + "2beta\352\002\035Google::Cloud::Retail::V2betab\006p" + + "roto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -383,6 +384,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "MatchingVariantCount", "MatchingVariantFields", "VariantRollupValues", + "PersonalLabels", }); internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_MatchingVariantFieldsEntry_descriptor = internal_static_google_cloud_retail_v2beta_SearchResponse_SearchResult_descriptor diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchSolutionUseCase.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchSolutionUseCase.java index 240a6fb892e1..c4196b1f9adf 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchSolutionUseCase.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/SearchSolutionUseCase.java @@ -33,7 +33,7 @@ public enum SearchSolutionUseCase implements com.google.protobuf.ProtocolMessage * *
    * The value when it's unspecified. In this case, server behavior defaults to
-   * [SEARCH_SOLUTION_USE_CASE_SEARCH][].
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH].
    * 
* * SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; @@ -69,7 +69,7 @@ public enum SearchSolutionUseCase implements com.google.protobuf.ProtocolMessage * *
    * The value when it's unspecified. In this case, server behavior defaults to
-   * [SEARCH_SOLUTION_USE_CASE_SEARCH][].
+   * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH].
    * 
* * SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0; diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfig.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfig.java index a60a2edf9019..5de4703bfd8d 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfig.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfig.java @@ -24,8 +24,6 @@ *
  * Configures metadata that is used to generate serving time results (e.g.
  * search results or recommendation predictions).
- * The ServingConfig is passed in the search and predict request and together
- * with the Catalog.default_branch, generates results.
  * 
* * Protobuf type {@code google.cloud.retail.v2beta.ServingConfig} @@ -55,6 +53,7 @@ private ServingConfig() { replacementControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; ignoreControlIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; diversityLevel_ = ""; + diversityType_ = 0; enableCategoryFilterLevel_ = ""; solutionTypes_ = java.util.Collections.emptyList(); } @@ -262,6 +261,31 @@ private ServingConfig( solutionTypes_.add(rawValue); } input.popLimit(oldLimit); + break; + } + case 160: + { + int rawValue = input.readEnum(); + + diversityType_ = rawValue; + break; + } + case 170: + { + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Builder subBuilder = + null; + if (personalizationSpec_ != null) { + subBuilder = personalizationSpec_.toBuilder(); + } + personalizationSpec_ = + input.readMessage( + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(personalizationSpec_); + personalizationSpec_ = subBuilder.buildPartial(); + } + break; } default: @@ -330,6 +354,164 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.retail.v2beta.ServingConfig.Builder.class); } + /** + * + * + *
+   * What type of diversity - data or rule based.
+   * If none is specified, default to rule based.
+   * 
+ * + * Protobuf enum {@code google.cloud.retail.v2beta.ServingConfig.DiversityType} + */ + public enum DiversityType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value.
+     * 
+ * + * DIVERSITY_TYPE_UNSPECIFIED = 0; + */ + DIVERSITY_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Rule based diversity.
+     * 
+ * + * RULE_BASED_DIVERSITY = 2; + */ + RULE_BASED_DIVERSITY(2), + /** + * + * + *
+     * Data driven diversity.
+     * 
+ * + * DATA_DRIVEN_DIVERSITY = 3; + */ + DATA_DRIVEN_DIVERSITY(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value.
+     * 
+ * + * DIVERSITY_TYPE_UNSPECIFIED = 0; + */ + public static final int DIVERSITY_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Rule based diversity.
+     * 
+ * + * RULE_BASED_DIVERSITY = 2; + */ + public static final int RULE_BASED_DIVERSITY_VALUE = 2; + /** + * + * + *
+     * Data driven diversity.
+     * 
+ * + * DATA_DRIVEN_DIVERSITY = 3; + */ + public static final int DATA_DRIVEN_DIVERSITY_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DiversityType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static DiversityType forNumber(int value) { + switch (value) { + case 0: + return DIVERSITY_TYPE_UNSPECIFIED; + case 2: + return RULE_BASED_DIVERSITY; + case 3: + return DATA_DRIVEN_DIVERSITY; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public DiversityType findValueByNumber(int number) { + return DiversityType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ServingConfig.getDescriptor().getEnumTypes().get(0); + } + + private static final DiversityType[] VALUES = values(); + + public static DiversityType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private DiversityType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.retail.v2beta.ServingConfig.DiversityType) + } + public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -442,7 +624,8 @@ public com.google.protobuf.ByteString getDisplayNameBytes() { * * *
-   * The id of the model to use at serving time.
+   * The id of the model in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog] to use at serving time.
    * Currently only RecommendationModels are supported:
    * https://cloud.google.com/retail/recommendations-ai/docs/create-models
    * Can be changed but only to a compatible model (e.g.
@@ -473,7 +656,8 @@ public java.lang.String getModelId() {
    *
    *
    * 
-   * The id of the model to use at serving time.
+   * The id of the model in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog] to use at serving time.
    * Currently only RecommendationModels are supported:
    * https://cloud.google.com/retail/recommendations-ai/docs/create-models
    * Can be changed but only to a compatible model (e.g.
@@ -513,12 +697,12 @@ public com.google.protobuf.ByteString getModelIdBytes() {
    * highest-priced items first. This setting could result in a decrease in
    * click-through and conversion rates.
    *  Allowed values are:
-   * * 'no-price-reranking'
-   * * 'low-price-raranking'
-   * * 'medium-price-reranking'
-   * * 'high-price-reranking'
+   * * `no-price-reranking`
+   * * `low-price-raranking`
+   * * `medium-price-reranking`
+   * * `high-price-reranking`
    * If not specified, we choose default based on model type. Default value:
-   * 'no-price-reranking'.
+   * `no-price-reranking`.
    * Can only be set if
    * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
    * is
@@ -551,12 +735,12 @@ public java.lang.String getPriceRerankingLevel() {
    * highest-priced items first. This setting could result in a decrease in
    * click-through and conversion rates.
    *  Allowed values are:
-   * * 'no-price-reranking'
-   * * 'low-price-raranking'
-   * * 'medium-price-reranking'
-   * * 'high-price-reranking'
+   * * `no-price-reranking`
+   * * `low-price-raranking`
+   * * `medium-price-reranking`
+   * * `high-price-reranking`
    * If not specified, we choose default based on model type. Default value:
-   * 'no-price-reranking'.
+   * `no-price-reranking`.
    * Can only be set if
    * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
    * is
@@ -1496,14 +1680,14 @@ public com.google.protobuf.ByteString getIgnoreControlIdsBytes(int index) {
    *
    * 
    * How much diversity to use in recommendation model results e.g.
-   * 'medium-diversity' or 'high-diversity'. Currently supported values:
-   * * 'no-diversity'
-   * * 'low-diversity'
-   * * 'medium-diversity'
-   * * 'high-diversity'
-   * * 'auto-diversity'
+   * `medium-diversity` or `high-diversity`. Currently supported values:
+   * * `no-diversity`
+   * * `low-diversity`
+   * * `medium-diversity`
+   * * `high-diversity`
+   * * `auto-diversity`
    * If not specified, we choose default based on recommendation model
-   * type. Default value: 'no-diversity'.
+   * type. Default value: `no-diversity`.
    * Can only be set if
    * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
    * is
@@ -1531,14 +1715,14 @@ public java.lang.String getDiversityLevel() {
    *
    * 
    * How much diversity to use in recommendation model results e.g.
-   * 'medium-diversity' or 'high-diversity'. Currently supported values:
-   * * 'no-diversity'
-   * * 'low-diversity'
-   * * 'medium-diversity'
-   * * 'high-diversity'
-   * * 'auto-diversity'
+   * `medium-diversity` or `high-diversity`. Currently supported values:
+   * * `no-diversity`
+   * * `low-diversity`
+   * * `medium-diversity`
+   * * `high-diversity`
+   * * `auto-diversity`
    * If not specified, we choose default based on recommendation model
-   * type. Default value: 'no-diversity'.
+   * type. Default value: `no-diversity`.
    * Can only be set if
    * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
    * is
@@ -1562,18 +1746,56 @@ public com.google.protobuf.ByteString getDiversityLevelBytes() {
     }
   }
 
+  public static final int DIVERSITY_TYPE_FIELD_NUMBER = 20;
+  private int diversityType_;
+  /**
+   *
+   *
+   * 
+   * What kind of diversity to use - data driven or rule based.
+   * 
+ * + * .google.cloud.retail.v2beta.ServingConfig.DiversityType diversity_type = 20; + * + * @return The enum numeric value on the wire for diversityType. + */ + @java.lang.Override + public int getDiversityTypeValue() { + return diversityType_; + } + /** + * + * + *
+   * What kind of diversity to use - data driven or rule based.
+   * 
+ * + * .google.cloud.retail.v2beta.ServingConfig.DiversityType diversity_type = 20; + * + * @return The diversityType. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ServingConfig.DiversityType getDiversityType() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.ServingConfig.DiversityType result = + com.google.cloud.retail.v2beta.ServingConfig.DiversityType.valueOf(diversityType_); + return result == null + ? com.google.cloud.retail.v2beta.ServingConfig.DiversityType.UNRECOGNIZED + : result; + } + public static final int ENABLE_CATEGORY_FILTER_LEVEL_FIELD_NUMBER = 16; private volatile java.lang.Object enableCategoryFilterLevel_; /** * * *
-   * Whether to add additional category filters on the 'similar-items' model.
+   * Whether to add additional category filters on the `similar-items` model.
    * If not specified, we enable it by default.
    *  Allowed values are:
-   * * 'no-category-match': No additional filtering of original results from
+   * * `no-category-match`: No additional filtering of original results from
    *   the model and the customer's filters.
-   * * 'relaxed-category-match': Only keep results with categories that match
+   * * `relaxed-category-match`: Only keep results with categories that match
    *   at least one item categories in the PredictRequests's context item.
    *   * If customer also sends filters in the PredictRequest, then the results
    *   will satisfy both conditions (user given and category match).
@@ -1603,12 +1825,12 @@ public java.lang.String getEnableCategoryFilterLevel() {
    *
    *
    * 
-   * Whether to add additional category filters on the 'similar-items' model.
+   * Whether to add additional category filters on the `similar-items` model.
    * If not specified, we enable it by default.
    *  Allowed values are:
-   * * 'no-category-match': No additional filtering of original results from
+   * * `no-category-match`: No additional filtering of original results from
    *   the model and the customer's filters.
-   * * 'relaxed-category-match': Only keep results with categories that match
+   * * `relaxed-category-match`: Only keep results with categories that match
    *   at least one item categories in the PredictRequests's context item.
    *   * If customer also sends filters in the PredictRequest, then the results
    *   will satisfy both conditions (user given and category match).
@@ -1635,6 +1857,94 @@ public com.google.protobuf.ByteString getEnableCategoryFilterLevelBytes() {
     }
   }
 
+  public static final int PERSONALIZATION_SPEC_FIELD_NUMBER = 21;
+  private com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalizationSpec_;
+  /**
+   *
+   *
+   * 
+   * The specification for personalization spec.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + * + * @return Whether the personalizationSpec field is set. + */ + @java.lang.Override + public boolean hasPersonalizationSpec() { + return personalizationSpec_ != null; + } + /** + * + * + *
+   * The specification for personalization spec.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + * + * @return The personalizationSpec. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec getPersonalizationSpec() { + return personalizationSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.getDefaultInstance() + : personalizationSpec_; + } + /** + * + * + *
+   * The specification for personalization spec.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpecOrBuilder + getPersonalizationSpecOrBuilder() { + return getPersonalizationSpec(); + } + public static final int SOLUTION_TYPES_FIELD_NUMBER = 19; private java.util.List solutionTypes_; private static final com.google.protobuf.Internal.ListAdapter.Converter< @@ -1822,6 +2132,14 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < solutionTypes_.size(); i++) { output.writeEnumNoTag(solutionTypes_.get(i)); } + if (diversityType_ + != com.google.cloud.retail.v2beta.ServingConfig.DiversityType.DIVERSITY_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(20, diversityType_); + } + if (personalizationSpec_ != null) { + output.writeMessage(21, getPersonalizationSpec()); + } unknownFields.writeTo(output); } @@ -1938,6 +2256,15 @@ public int getSerializedSize() { } solutionTypesMemoizedSerializedSize = dataSize; } + if (diversityType_ + != com.google.cloud.retail.v2beta.ServingConfig.DiversityType.DIVERSITY_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(20, diversityType_); + } + if (personalizationSpec_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(21, getPersonalizationSpec()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1975,7 +2302,12 @@ public boolean equals(final java.lang.Object obj) { if (!getReplacementControlIdsList().equals(other.getReplacementControlIdsList())) return false; if (!getIgnoreControlIdsList().equals(other.getIgnoreControlIdsList())) return false; if (!getDiversityLevel().equals(other.getDiversityLevel())) return false; + if (diversityType_ != other.diversityType_) return false; if (!getEnableCategoryFilterLevel().equals(other.getEnableCategoryFilterLevel())) return false; + if (hasPersonalizationSpec() != other.hasPersonalizationSpec()) return false; + if (hasPersonalizationSpec()) { + if (!getPersonalizationSpec().equals(other.getPersonalizationSpec())) return false; + } if (!solutionTypes_.equals(other.solutionTypes_)) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; @@ -2038,8 +2370,14 @@ public int hashCode() { } hash = (37 * hash) + DIVERSITY_LEVEL_FIELD_NUMBER; hash = (53 * hash) + getDiversityLevel().hashCode(); + hash = (37 * hash) + DIVERSITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + diversityType_; hash = (37 * hash) + ENABLE_CATEGORY_FILTER_LEVEL_FIELD_NUMBER; hash = (53 * hash) + getEnableCategoryFilterLevel().hashCode(); + if (hasPersonalizationSpec()) { + hash = (37 * hash) + PERSONALIZATION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getPersonalizationSpec().hashCode(); + } if (getSolutionTypesCount() > 0) { hash = (37 * hash) + SOLUTION_TYPES_FIELD_NUMBER; hash = (53 * hash) + solutionTypes_.hashCode(); @@ -2150,8 +2488,6 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build *
    * Configures metadata that is used to generate serving time results (e.g.
    * search results or recommendation predictions).
-   * The ServingConfig is passed in the search and predict request and together
-   * with the Catalog.default_branch, generates results.
    * 
* * Protobuf type {@code google.cloud.retail.v2beta.ServingConfig} @@ -2226,8 +2562,16 @@ public Builder clear() { bitField0_ = (bitField0_ & ~0x00000100); diversityLevel_ = ""; + diversityType_ = 0; + enableCategoryFilterLevel_ = ""; + if (personalizationSpecBuilder_ == null) { + personalizationSpec_ = null; + } else { + personalizationSpec_ = null; + personalizationSpecBuilder_ = null; + } solutionTypes_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000200); return this; @@ -2313,7 +2657,13 @@ public com.google.cloud.retail.v2beta.ServingConfig buildPartial() { } result.ignoreControlIds_ = ignoreControlIds_; result.diversityLevel_ = diversityLevel_; + result.diversityType_ = diversityType_; result.enableCategoryFilterLevel_ = enableCategoryFilterLevel_; + if (personalizationSpecBuilder_ == null) { + result.personalizationSpec_ = personalizationSpec_; + } else { + result.personalizationSpec_ = personalizationSpecBuilder_.build(); + } if (((bitField0_ & 0x00000200) != 0)) { solutionTypes_ = java.util.Collections.unmodifiableList(solutionTypes_); bitField0_ = (bitField0_ & ~0x00000200); @@ -2481,10 +2831,16 @@ public Builder mergeFrom(com.google.cloud.retail.v2beta.ServingConfig other) { diversityLevel_ = other.diversityLevel_; onChanged(); } + if (other.diversityType_ != 0) { + setDiversityTypeValue(other.getDiversityTypeValue()); + } if (!other.getEnableCategoryFilterLevel().isEmpty()) { enableCategoryFilterLevel_ = other.enableCategoryFilterLevel_; onChanged(); } + if (other.hasPersonalizationSpec()) { + mergePersonalizationSpec(other.getPersonalizationSpec()); + } if (!other.solutionTypes_.isEmpty()) { if (solutionTypes_.isEmpty()) { solutionTypes_ = other.solutionTypes_; @@ -2763,7 +3119,8 @@ public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { * * *
-     * The id of the model to use at serving time.
+     * The id of the model in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to use at serving time.
      * Currently only RecommendationModels are supported:
      * https://cloud.google.com/retail/recommendations-ai/docs/create-models
      * Can be changed but only to a compatible model (e.g.
@@ -2793,7 +3150,8 @@ public java.lang.String getModelId() {
      *
      *
      * 
-     * The id of the model to use at serving time.
+     * The id of the model in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to use at serving time.
      * Currently only RecommendationModels are supported:
      * https://cloud.google.com/retail/recommendations-ai/docs/create-models
      * Can be changed but only to a compatible model (e.g.
@@ -2823,7 +3181,8 @@ public com.google.protobuf.ByteString getModelIdBytes() {
      *
      *
      * 
-     * The id of the model to use at serving time.
+     * The id of the model in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to use at serving time.
      * Currently only RecommendationModels are supported:
      * https://cloud.google.com/retail/recommendations-ai/docs/create-models
      * Can be changed but only to a compatible model (e.g.
@@ -2852,7 +3211,8 @@ public Builder setModelId(java.lang.String value) {
      *
      *
      * 
-     * The id of the model to use at serving time.
+     * The id of the model in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to use at serving time.
      * Currently only RecommendationModels are supported:
      * https://cloud.google.com/retail/recommendations-ai/docs/create-models
      * Can be changed but only to a compatible model (e.g.
@@ -2877,7 +3237,8 @@ public Builder clearModelId() {
      *
      *
      * 
-     * The id of the model to use at serving time.
+     * The id of the model in the same
+     * [Catalog][google.cloud.retail.v2beta.Catalog] to use at serving time.
      * Currently only RecommendationModels are supported:
      * https://cloud.google.com/retail/recommendations-ai/docs/create-models
      * Can be changed but only to a compatible model (e.g.
@@ -2915,12 +3276,12 @@ public Builder setModelIdBytes(com.google.protobuf.ByteString value) {
      * highest-priced items first. This setting could result in a decrease in
      * click-through and conversion rates.
      *  Allowed values are:
-     * * 'no-price-reranking'
-     * * 'low-price-raranking'
-     * * 'medium-price-reranking'
-     * * 'high-price-reranking'
+     * * `no-price-reranking`
+     * * `low-price-raranking`
+     * * `medium-price-reranking`
+     * * `high-price-reranking`
      * If not specified, we choose default based on model type. Default value:
-     * 'no-price-reranking'.
+     * `no-price-reranking`.
      * Can only be set if
      * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
      * is
@@ -2952,12 +3313,12 @@ public java.lang.String getPriceRerankingLevel() {
      * highest-priced items first. This setting could result in a decrease in
      * click-through and conversion rates.
      *  Allowed values are:
-     * * 'no-price-reranking'
-     * * 'low-price-raranking'
-     * * 'medium-price-reranking'
-     * * 'high-price-reranking'
+     * * `no-price-reranking`
+     * * `low-price-raranking`
+     * * `medium-price-reranking`
+     * * `high-price-reranking`
      * If not specified, we choose default based on model type. Default value:
-     * 'no-price-reranking'.
+     * `no-price-reranking`.
      * Can only be set if
      * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
      * is
@@ -2989,12 +3350,12 @@ public com.google.protobuf.ByteString getPriceRerankingLevelBytes() {
      * highest-priced items first. This setting could result in a decrease in
      * click-through and conversion rates.
      *  Allowed values are:
-     * * 'no-price-reranking'
-     * * 'low-price-raranking'
-     * * 'medium-price-reranking'
-     * * 'high-price-reranking'
+     * * `no-price-reranking`
+     * * `low-price-raranking`
+     * * `medium-price-reranking`
+     * * `high-price-reranking`
      * If not specified, we choose default based on model type. Default value:
-     * 'no-price-reranking'.
+     * `no-price-reranking`.
      * Can only be set if
      * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
      * is
@@ -3025,12 +3386,12 @@ public Builder setPriceRerankingLevel(java.lang.String value) {
      * highest-priced items first. This setting could result in a decrease in
      * click-through and conversion rates.
      *  Allowed values are:
-     * * 'no-price-reranking'
-     * * 'low-price-raranking'
-     * * 'medium-price-reranking'
-     * * 'high-price-reranking'
+     * * `no-price-reranking`
+     * * `low-price-raranking`
+     * * `medium-price-reranking`
+     * * `high-price-reranking`
      * If not specified, we choose default based on model type. Default value:
-     * 'no-price-reranking'.
+     * `no-price-reranking`.
      * Can only be set if
      * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
      * is
@@ -3057,12 +3418,12 @@ public Builder clearPriceRerankingLevel() {
      * highest-priced items first. This setting could result in a decrease in
      * click-through and conversion rates.
      *  Allowed values are:
-     * * 'no-price-reranking'
-     * * 'low-price-raranking'
-     * * 'medium-price-reranking'
-     * * 'high-price-reranking'
+     * * `no-price-reranking`
+     * * `low-price-raranking`
+     * * `medium-price-reranking`
+     * * `high-price-reranking`
      * If not specified, we choose default based on model type. Default value:
-     * 'no-price-reranking'.
+     * `no-price-reranking`.
      * Can only be set if
      * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
      * is
@@ -5518,14 +5879,14 @@ public Builder addIgnoreControlIdsBytes(com.google.protobuf.ByteString value) {
      *
      * 
      * How much diversity to use in recommendation model results e.g.
-     * 'medium-diversity' or 'high-diversity'. Currently supported values:
-     * * 'no-diversity'
-     * * 'low-diversity'
-     * * 'medium-diversity'
-     * * 'high-diversity'
-     * * 'auto-diversity'
+     * `medium-diversity` or `high-diversity`. Currently supported values:
+     * * `no-diversity`
+     * * `low-diversity`
+     * * `medium-diversity`
+     * * `high-diversity`
+     * * `auto-diversity`
      * If not specified, we choose default based on recommendation model
-     * type. Default value: 'no-diversity'.
+     * type. Default value: `no-diversity`.
      * Can only be set if
      * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
      * is
@@ -5552,14 +5913,14 @@ public java.lang.String getDiversityLevel() {
      *
      * 
      * How much diversity to use in recommendation model results e.g.
-     * 'medium-diversity' or 'high-diversity'. Currently supported values:
-     * * 'no-diversity'
-     * * 'low-diversity'
-     * * 'medium-diversity'
-     * * 'high-diversity'
-     * * 'auto-diversity'
+     * `medium-diversity` or `high-diversity`. Currently supported values:
+     * * `no-diversity`
+     * * `low-diversity`
+     * * `medium-diversity`
+     * * `high-diversity`
+     * * `auto-diversity`
      * If not specified, we choose default based on recommendation model
-     * type. Default value: 'no-diversity'.
+     * type. Default value: `no-diversity`.
      * Can only be set if
      * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
      * is
@@ -5586,14 +5947,14 @@ public com.google.protobuf.ByteString getDiversityLevelBytes() {
      *
      * 
      * How much diversity to use in recommendation model results e.g.
-     * 'medium-diversity' or 'high-diversity'. Currently supported values:
-     * * 'no-diversity'
-     * * 'low-diversity'
-     * * 'medium-diversity'
-     * * 'high-diversity'
-     * * 'auto-diversity'
+     * `medium-diversity` or `high-diversity`. Currently supported values:
+     * * `no-diversity`
+     * * `low-diversity`
+     * * `medium-diversity`
+     * * `high-diversity`
+     * * `auto-diversity`
      * If not specified, we choose default based on recommendation model
-     * type. Default value: 'no-diversity'.
+     * type. Default value: `no-diversity`.
      * Can only be set if
      * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
      * is
@@ -5619,14 +5980,14 @@ public Builder setDiversityLevel(java.lang.String value) {
      *
      * 
      * How much diversity to use in recommendation model results e.g.
-     * 'medium-diversity' or 'high-diversity'. Currently supported values:
-     * * 'no-diversity'
-     * * 'low-diversity'
-     * * 'medium-diversity'
-     * * 'high-diversity'
-     * * 'auto-diversity'
+     * `medium-diversity` or `high-diversity`. Currently supported values:
+     * * `no-diversity`
+     * * `low-diversity`
+     * * `medium-diversity`
+     * * `high-diversity`
+     * * `auto-diversity`
      * If not specified, we choose default based on recommendation model
-     * type. Default value: 'no-diversity'.
+     * type. Default value: `no-diversity`.
      * Can only be set if
      * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
      * is
@@ -5648,14 +6009,14 @@ public Builder clearDiversityLevel() {
      *
      * 
      * How much diversity to use in recommendation model results e.g.
-     * 'medium-diversity' or 'high-diversity'. Currently supported values:
-     * * 'no-diversity'
-     * * 'low-diversity'
-     * * 'medium-diversity'
-     * * 'high-diversity'
-     * * 'auto-diversity'
+     * `medium-diversity` or `high-diversity`. Currently supported values:
+     * * `no-diversity`
+     * * `low-diversity`
+     * * `medium-diversity`
+     * * `high-diversity`
+     * * `auto-diversity`
      * If not specified, we choose default based on recommendation model
-     * type. Default value: 'no-diversity'.
+     * type. Default value: `no-diversity`.
      * Can only be set if
      * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
      * is
@@ -5678,17 +6039,111 @@ public Builder setDiversityLevelBytes(com.google.protobuf.ByteString value) {
       return this;
     }
 
+    private int diversityType_ = 0;
+    /**
+     *
+     *
+     * 
+     * What kind of diversity to use - data driven or rule based.
+     * 
+ * + * .google.cloud.retail.v2beta.ServingConfig.DiversityType diversity_type = 20; + * + * @return The enum numeric value on the wire for diversityType. + */ + @java.lang.Override + public int getDiversityTypeValue() { + return diversityType_; + } + /** + * + * + *
+     * What kind of diversity to use - data driven or rule based.
+     * 
+ * + * .google.cloud.retail.v2beta.ServingConfig.DiversityType diversity_type = 20; + * + * @param value The enum numeric value on the wire for diversityType to set. + * @return This builder for chaining. + */ + public Builder setDiversityTypeValue(int value) { + + diversityType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * What kind of diversity to use - data driven or rule based.
+     * 
+ * + * .google.cloud.retail.v2beta.ServingConfig.DiversityType diversity_type = 20; + * + * @return The diversityType. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ServingConfig.DiversityType getDiversityType() { + @SuppressWarnings("deprecation") + com.google.cloud.retail.v2beta.ServingConfig.DiversityType result = + com.google.cloud.retail.v2beta.ServingConfig.DiversityType.valueOf(diversityType_); + return result == null + ? com.google.cloud.retail.v2beta.ServingConfig.DiversityType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * What kind of diversity to use - data driven or rule based.
+     * 
+ * + * .google.cloud.retail.v2beta.ServingConfig.DiversityType diversity_type = 20; + * + * @param value The diversityType to set. + * @return This builder for chaining. + */ + public Builder setDiversityType( + com.google.cloud.retail.v2beta.ServingConfig.DiversityType value) { + if (value == null) { + throw new NullPointerException(); + } + + diversityType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * What kind of diversity to use - data driven or rule based.
+     * 
+ * + * .google.cloud.retail.v2beta.ServingConfig.DiversityType diversity_type = 20; + * + * @return This builder for chaining. + */ + public Builder clearDiversityType() { + + diversityType_ = 0; + onChanged(); + return this; + } + private java.lang.Object enableCategoryFilterLevel_ = ""; /** * * *
-     * Whether to add additional category filters on the 'similar-items' model.
+     * Whether to add additional category filters on the `similar-items` model.
      * If not specified, we enable it by default.
      *  Allowed values are:
-     * * 'no-category-match': No additional filtering of original results from
+     * * `no-category-match`: No additional filtering of original results from
      *   the model and the customer's filters.
-     * * 'relaxed-category-match': Only keep results with categories that match
+     * * `relaxed-category-match`: Only keep results with categories that match
      *   at least one item categories in the PredictRequests's context item.
      *   * If customer also sends filters in the PredictRequest, then the results
      *   will satisfy both conditions (user given and category match).
@@ -5717,12 +6172,12 @@ public java.lang.String getEnableCategoryFilterLevel() {
      *
      *
      * 
-     * Whether to add additional category filters on the 'similar-items' model.
+     * Whether to add additional category filters on the `similar-items` model.
      * If not specified, we enable it by default.
      *  Allowed values are:
-     * * 'no-category-match': No additional filtering of original results from
+     * * `no-category-match`: No additional filtering of original results from
      *   the model and the customer's filters.
-     * * 'relaxed-category-match': Only keep results with categories that match
+     * * `relaxed-category-match`: Only keep results with categories that match
      *   at least one item categories in the PredictRequests's context item.
      *   * If customer also sends filters in the PredictRequest, then the results
      *   will satisfy both conditions (user given and category match).
@@ -5751,12 +6206,12 @@ public com.google.protobuf.ByteString getEnableCategoryFilterLevelBytes() {
      *
      *
      * 
-     * Whether to add additional category filters on the 'similar-items' model.
+     * Whether to add additional category filters on the `similar-items` model.
      * If not specified, we enable it by default.
      *  Allowed values are:
-     * * 'no-category-match': No additional filtering of original results from
+     * * `no-category-match`: No additional filtering of original results from
      *   the model and the customer's filters.
-     * * 'relaxed-category-match': Only keep results with categories that match
+     * * `relaxed-category-match`: Only keep results with categories that match
      *   at least one item categories in the PredictRequests's context item.
      *   * If customer also sends filters in the PredictRequest, then the results
      *   will satisfy both conditions (user given and category match).
@@ -5784,12 +6239,12 @@ public Builder setEnableCategoryFilterLevel(java.lang.String value) {
      *
      *
      * 
-     * Whether to add additional category filters on the 'similar-items' model.
+     * Whether to add additional category filters on the `similar-items` model.
      * If not specified, we enable it by default.
      *  Allowed values are:
-     * * 'no-category-match': No additional filtering of original results from
+     * * `no-category-match`: No additional filtering of original results from
      *   the model and the customer's filters.
-     * * 'relaxed-category-match': Only keep results with categories that match
+     * * `relaxed-category-match`: Only keep results with categories that match
      *   at least one item categories in the PredictRequests's context item.
      *   * If customer also sends filters in the PredictRequest, then the results
      *   will satisfy both conditions (user given and category match).
@@ -5813,12 +6268,12 @@ public Builder clearEnableCategoryFilterLevel() {
      *
      *
      * 
-     * Whether to add additional category filters on the 'similar-items' model.
+     * Whether to add additional category filters on the `similar-items` model.
      * If not specified, we enable it by default.
      *  Allowed values are:
-     * * 'no-category-match': No additional filtering of original results from
+     * * `no-category-match`: No additional filtering of original results from
      *   the model and the customer's filters.
-     * * 'relaxed-category-match': Only keep results with categories that match
+     * * `relaxed-category-match`: Only keep results with categories that match
      *   at least one item categories in the PredictRequests's context item.
      *   * If customer also sends filters in the PredictRequest, then the results
      *   will satisfy both conditions (user given and category match).
@@ -5844,6 +6299,324 @@ public Builder setEnableCategoryFilterLevelBytes(com.google.protobuf.ByteString
       return this;
     }
 
+    private com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalizationSpec_;
+    private com.google.protobuf.SingleFieldBuilderV3<
+            com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec,
+            com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Builder,
+            com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpecOrBuilder>
+        personalizationSpecBuilder_;
+    /**
+     *
+     *
+     * 
+     * The specification for personalization spec.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + * + * @return Whether the personalizationSpec field is set. + */ + public boolean hasPersonalizationSpec() { + return personalizationSpecBuilder_ != null || personalizationSpec_ != null; + } + /** + * + * + *
+     * The specification for personalization spec.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + * + * @return The personalizationSpec. + */ + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec + getPersonalizationSpec() { + if (personalizationSpecBuilder_ == null) { + return personalizationSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.getDefaultInstance() + : personalizationSpec_; + } else { + return personalizationSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The specification for personalization spec.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + */ + public Builder setPersonalizationSpec( + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec value) { + if (personalizationSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + personalizationSpec_ = value; + onChanged(); + } else { + personalizationSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The specification for personalization spec.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + */ + public Builder setPersonalizationSpec( + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Builder builderForValue) { + if (personalizationSpecBuilder_ == null) { + personalizationSpec_ = builderForValue.build(); + onChanged(); + } else { + personalizationSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The specification for personalization spec.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + */ + public Builder mergePersonalizationSpec( + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec value) { + if (personalizationSpecBuilder_ == null) { + if (personalizationSpec_ != null) { + personalizationSpec_ = + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.newBuilder( + personalizationSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + personalizationSpec_ = value; + } + onChanged(); + } else { + personalizationSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The specification for personalization spec.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + */ + public Builder clearPersonalizationSpec() { + if (personalizationSpecBuilder_ == null) { + personalizationSpec_ = null; + onChanged(); + } else { + personalizationSpec_ = null; + personalizationSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The specification for personalization spec.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Builder + getPersonalizationSpecBuilder() { + + onChanged(); + return getPersonalizationSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The specification for personalization spec.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + */ + public com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpecOrBuilder + getPersonalizationSpecOrBuilder() { + if (personalizationSpecBuilder_ != null) { + return personalizationSpecBuilder_.getMessageOrBuilder(); + } else { + return personalizationSpec_ == null + ? com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.getDefaultInstance() + : personalizationSpec_; + } + } + /** + * + * + *
+     * The specification for personalization spec.
+     * Can only be set if
+     * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+     * is
+     * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+     * Notice that if both
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+     * and
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * are set.
+     * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+     * will override
+     * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+     * 
+ * + * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec, + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpecOrBuilder> + getPersonalizationSpecFieldBuilder() { + if (personalizationSpecBuilder_ == null) { + personalizationSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec, + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Builder, + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpecOrBuilder>( + getPersonalizationSpec(), getParentForChildren(), isClean()); + personalizationSpec_ = null; + } + return personalizationSpecBuilder_; + } + private java.util.List solutionTypes_ = java.util.Collections.emptyList(); private void ensureSolutionTypesIsMutable() { diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigOrBuilder.java index 11b10102c570..c534449ceb7b 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigOrBuilder.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigOrBuilder.java @@ -85,7 +85,8 @@ public interface ServingConfigOrBuilder * * *
-   * The id of the model to use at serving time.
+   * The id of the model in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog] to use at serving time.
    * Currently only RecommendationModels are supported:
    * https://cloud.google.com/retail/recommendations-ai/docs/create-models
    * Can be changed but only to a compatible model (e.g.
@@ -105,7 +106,8 @@ public interface ServingConfigOrBuilder
    *
    *
    * 
-   * The id of the model to use at serving time.
+   * The id of the model in the same
+   * [Catalog][google.cloud.retail.v2beta.Catalog] to use at serving time.
    * Currently only RecommendationModels are supported:
    * https://cloud.google.com/retail/recommendations-ai/docs/create-models
    * Can be changed but only to a compatible model (e.g.
@@ -132,12 +134,12 @@ public interface ServingConfigOrBuilder
    * highest-priced items first. This setting could result in a decrease in
    * click-through and conversion rates.
    *  Allowed values are:
-   * * 'no-price-reranking'
-   * * 'low-price-raranking'
-   * * 'medium-price-reranking'
-   * * 'high-price-reranking'
+   * * `no-price-reranking`
+   * * `low-price-raranking`
+   * * `medium-price-reranking`
+   * * `high-price-reranking`
    * If not specified, we choose default based on model type. Default value:
-   * 'no-price-reranking'.
+   * `no-price-reranking`.
    * Can only be set if
    * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
    * is
@@ -159,12 +161,12 @@ public interface ServingConfigOrBuilder
    * highest-priced items first. This setting could result in a decrease in
    * click-through and conversion rates.
    *  Allowed values are:
-   * * 'no-price-reranking'
-   * * 'low-price-raranking'
-   * * 'medium-price-reranking'
-   * * 'high-price-reranking'
+   * * `no-price-reranking`
+   * * `low-price-raranking`
+   * * `medium-price-reranking`
+   * * `high-price-reranking`
    * If not specified, we choose default based on model type. Default value:
-   * 'no-price-reranking'.
+   * `no-price-reranking`.
    * Can only be set if
    * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
    * is
@@ -988,14 +990,14 @@ public interface ServingConfigOrBuilder
    *
    * 
    * How much diversity to use in recommendation model results e.g.
-   * 'medium-diversity' or 'high-diversity'. Currently supported values:
-   * * 'no-diversity'
-   * * 'low-diversity'
-   * * 'medium-diversity'
-   * * 'high-diversity'
-   * * 'auto-diversity'
+   * `medium-diversity` or `high-diversity`. Currently supported values:
+   * * `no-diversity`
+   * * `low-diversity`
+   * * `medium-diversity`
+   * * `high-diversity`
+   * * `auto-diversity`
    * If not specified, we choose default based on recommendation model
-   * type. Default value: 'no-diversity'.
+   * type. Default value: `no-diversity`.
    * Can only be set if
    * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
    * is
@@ -1012,14 +1014,14 @@ public interface ServingConfigOrBuilder
    *
    * 
    * How much diversity to use in recommendation model results e.g.
-   * 'medium-diversity' or 'high-diversity'. Currently supported values:
-   * * 'no-diversity'
-   * * 'low-diversity'
-   * * 'medium-diversity'
-   * * 'high-diversity'
-   * * 'auto-diversity'
+   * `medium-diversity` or `high-diversity`. Currently supported values:
+   * * `no-diversity`
+   * * `low-diversity`
+   * * `medium-diversity`
+   * * `high-diversity`
+   * * `auto-diversity`
    * If not specified, we choose default based on recommendation model
-   * type. Default value: 'no-diversity'.
+   * type. Default value: `no-diversity`.
    * Can only be set if
    * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
    * is
@@ -1036,12 +1038,37 @@ public interface ServingConfigOrBuilder
    *
    *
    * 
-   * Whether to add additional category filters on the 'similar-items' model.
+   * What kind of diversity to use - data driven or rule based.
+   * 
+ * + * .google.cloud.retail.v2beta.ServingConfig.DiversityType diversity_type = 20; + * + * @return The enum numeric value on the wire for diversityType. + */ + int getDiversityTypeValue(); + /** + * + * + *
+   * What kind of diversity to use - data driven or rule based.
+   * 
+ * + * .google.cloud.retail.v2beta.ServingConfig.DiversityType diversity_type = 20; + * + * @return The diversityType. + */ + com.google.cloud.retail.v2beta.ServingConfig.DiversityType getDiversityType(); + + /** + * + * + *
+   * Whether to add additional category filters on the `similar-items` model.
    * If not specified, we enable it by default.
    *  Allowed values are:
-   * * 'no-category-match': No additional filtering of original results from
+   * * `no-category-match`: No additional filtering of original results from
    *   the model and the customer's filters.
-   * * 'relaxed-category-match': Only keep results with categories that match
+   * * `relaxed-category-match`: Only keep results with categories that match
    *   at least one item categories in the PredictRequests's context item.
    *   * If customer also sends filters in the PredictRequest, then the results
    *   will satisfy both conditions (user given and category match).
@@ -1060,12 +1087,12 @@ public interface ServingConfigOrBuilder
    *
    *
    * 
-   * Whether to add additional category filters on the 'similar-items' model.
+   * Whether to add additional category filters on the `similar-items` model.
    * If not specified, we enable it by default.
    *  Allowed values are:
-   * * 'no-category-match': No additional filtering of original results from
+   * * `no-category-match`: No additional filtering of original results from
    *   the model and the customer's filters.
-   * * 'relaxed-category-match': Only keep results with categories that match
+   * * `relaxed-category-match`: Only keep results with categories that match
    *   at least one item categories in the PredictRequests's context item.
    *   * If customer also sends filters in the PredictRequest, then the results
    *   will satisfy both conditions (user given and category match).
@@ -1081,6 +1108,81 @@ public interface ServingConfigOrBuilder
    */
   com.google.protobuf.ByteString getEnableCategoryFilterLevelBytes();
 
+  /**
+   *
+   *
+   * 
+   * The specification for personalization spec.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + * + * @return Whether the personalizationSpec field is set. + */ + boolean hasPersonalizationSpec(); + /** + * + * + *
+   * The specification for personalization spec.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + * + * @return The personalizationSpec. + */ + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec getPersonalizationSpec(); + /** + * + * + *
+   * The specification for personalization spec.
+   * Can only be set if
+   * [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+   * is
+   * [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+   * Notice that if both
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+   * and
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * are set.
+   * [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+   * will override
+   * [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+   * 
+ * + * .google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec personalization_spec = 21; + * + */ + com.google.cloud.retail.v2beta.SearchRequest.PersonalizationSpecOrBuilder + getPersonalizationSpecOrBuilder(); + /** * * diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigProto.java index 3db5ac085710..2bc7681bed50 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigProto.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/ServingConfigProto.java @@ -45,7 +45,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "oogle/api/field_behavior.proto\032\031google/a" + "pi/resource.proto\032\'google/cloud/retail/v" + "2beta/common.proto\032/google/cloud/retail/" - + "v2beta/search_service.proto\"\364\005\n\rServingC" + + "v2beta/search_service.proto\"\210\010\n\rServingC" + "onfig\022\021\n\004name\030\001 \001(\tB\003\340A\005\022\031\n\014display_name" + "\030\002 \001(\tB\003\340A\002\022\020\n\010model_id\030\003 \001(\t\022\035\n\025price_r" + "eranking_level\030\004 \001(\t\022\031\n\021facet_control_id" @@ -58,19 +58,26 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "trol_ids\030\014 \003(\t\022$\n\034do_not_associate_contr" + "ol_ids\030\r \003(\t\022\037\n\027replacement_control_ids\030" + "\016 \003(\t\022\032\n\022ignore_control_ids\030\017 \003(\t\022\027\n\017div" - + "ersity_level\030\010 \001(\t\022$\n\034enable_category_fi" - + "lter_level\030\020 \001(\t\022H\n\016solution_types\030\023 \003(\016" - + "2(.google.cloud.retail.v2beta.SolutionTy" - + "peB\006\340A\002\340A\005:\205\001\352A\201\001\n#retail.googleapis.com" - + "/ServingConfig\022Zprojects/{project}/locat" - + "ions/{location}/catalogs/{catalog}/servi" - + "ngConfigs/{serving_config}B\333\001\n\036com.googl" - + "e.cloud.retail.v2betaB\022ServingConfigProt" - + "oP\001Z@google.golang.org/genproto/googleap" - + "is/cloud/retail/v2beta;retail\242\002\006RETAIL\252\002" - + "\032Google.Cloud.Retail.V2Beta\312\002\032Google\\Clo" - + "ud\\Retail\\V2beta\352\002\035Google::Cloud::Retail" - + "::V2betab\006proto3" + + "ersity_level\030\010 \001(\t\022O\n\016diversity_type\030\024 \001" + + "(\01627.google.cloud.retail.v2beta.ServingC" + + "onfig.DiversityType\022$\n\034enable_category_f" + + "ilter_level\030\020 \001(\t\022[\n\024personalization_spe" + + "c\030\025 \001(\0132=.google.cloud.retail.v2beta.Sea" + + "rchRequest.PersonalizationSpec\022H\n\016soluti" + + "on_types\030\023 \003(\0162(.google.cloud.retail.v2b" + + "eta.SolutionTypeB\006\340A\002\340A\005\"d\n\rDiversityTyp" + + "e\022\036\n\032DIVERSITY_TYPE_UNSPECIFIED\020\000\022\030\n\024RUL" + + "E_BASED_DIVERSITY\020\002\022\031\n\025DATA_DRIVEN_DIVER" + + "SITY\020\003:\205\001\352A\201\001\n#retail.googleapis.com/Ser" + + "vingConfig\022Zprojects/{project}/locations" + + "/{location}/catalogs/{catalog}/servingCo" + + "nfigs/{serving_config}B\333\001\n\036com.google.cl" + + "oud.retail.v2betaB\022ServingConfigProtoP\001Z" + + "@google.golang.org/genproto/googleapis/c" + + "loud/retail/v2beta;retail\242\002\006RETAIL\252\002\032Goo" + + "gle.Cloud.Retail.V2Beta\312\002\032Google\\Cloud\\R" + + "etail\\V2beta\352\002\035Google::Cloud::Retail::V2" + + "betab\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -102,7 +109,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ReplacementControlIds", "IgnoreControlIds", "DiversityLevel", + "DiversityType", "EnableCategoryFilterLevel", + "PersonalizationSpec", "SolutionTypes", }); com.google.protobuf.ExtensionRegistry registry = diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelMetadata.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelMetadata.java new file mode 100644 index 000000000000..202517d30e8e --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelMetadata.java @@ -0,0 +1,651 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Metadata associated with a tune operation.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.TuneModelMetadata} + */ +public final class TuneModelMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.TuneModelMetadata) + TuneModelMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use TuneModelMetadata.newBuilder() to construct. + private TuneModelMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TuneModelMetadata() { + model_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TuneModelMetadata(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TuneModelMetadata( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + model_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.TuneModelMetadata.class, + com.google.cloud.retail.v2beta.TuneModelMetadata.Builder.class); + } + + public static final int MODEL_FIELD_NUMBER = 1; + private volatile java.lang.Object model_; + /** + * + * + *
+   * The resource name of the model that this tune applies to.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string model = 1; + * + * @return The model. + */ + @java.lang.Override + public java.lang.String getModel() { + java.lang.Object ref = model_; + 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(); + model_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the model that this tune applies to.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string model = 1; + * + * @return The bytes for model. + */ + @java.lang.Override + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = 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(model_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, model_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, model_); + } + size += unknownFields.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.TuneModelMetadata)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.TuneModelMetadata other = + (com.google.cloud.retail.v2beta.TuneModelMetadata) obj; + + if (!getModel().equals(other.getModel())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.TuneModelMetadata parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.TuneModelMetadata 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.TuneModelMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.TuneModelMetadata 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.TuneModelMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.TuneModelMetadata 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.TuneModelMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.TuneModelMetadata 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.TuneModelMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.TuneModelMetadata 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.TuneModelMetadata 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.TuneModelMetadata 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.TuneModelMetadata 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; + } + /** + * + * + *
+   * Metadata associated with a tune operation.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.TuneModelMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.TuneModelMetadata) + com.google.cloud.retail.v2beta.TuneModelMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.TuneModelMetadata.class, + com.google.cloud.retail.v2beta.TuneModelMetadata.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.TuneModelMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + model_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.TuneModelMetadata getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.TuneModelMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.TuneModelMetadata build() { + com.google.cloud.retail.v2beta.TuneModelMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.TuneModelMetadata buildPartial() { + com.google.cloud.retail.v2beta.TuneModelMetadata result = + new com.google.cloud.retail.v2beta.TuneModelMetadata(this); + result.model_ = model_; + onBuilt(); + return result; + } + + @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.TuneModelMetadata) { + return mergeFrom((com.google.cloud.retail.v2beta.TuneModelMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.TuneModelMetadata other) { + if (other == com.google.cloud.retail.v2beta.TuneModelMetadata.getDefaultInstance()) + return this; + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.TuneModelMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.TuneModelMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object model_ = ""; + /** + * + * + *
+     * The resource name of the model that this tune applies to.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string model = 1; + * + * @return The model. + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the model that this tune applies to.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string model = 1; + * + * @return The bytes for model. + */ + public com.google.protobuf.ByteString getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the model that this tune applies to.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string model = 1; + * + * @param value The model to set. + * @return This builder for chaining. + */ + public Builder setModel(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + model_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the model that this tune applies to.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string model = 1; + * + * @return This builder for chaining. + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the model that this tune applies to.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * string model = 1; + * + * @param value The bytes for model to set. + * @return This builder for chaining. + */ + public Builder setModelBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + model_ = value; + 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.TuneModelMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.TuneModelMetadata) + private static final com.google.cloud.retail.v2beta.TuneModelMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.TuneModelMetadata(); + } + + public static com.google.cloud.retail.v2beta.TuneModelMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TuneModelMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TuneModelMetadata(input, extensionRegistry); + } + }; + + 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.TuneModelMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelMetadataOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelMetadataOrBuilder.java new file mode 100644 index 000000000000..428f9a35b672 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelMetadataOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public interface TuneModelMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.TuneModelMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the model that this tune applies to.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string model = 1; + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * The resource name of the model that this tune applies to.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * string model = 1; + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelRequest.java new file mode 100644 index 000000000000..a6eb29b62f2a --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelRequest.java @@ -0,0 +1,667 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request to manually start a tuning process now (instead of waiting for
+ * the periodically scheduled tuning to happen).
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.TuneModelRequest} + */ +public final class TuneModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.TuneModelRequest) + TuneModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use TuneModelRequest.newBuilder() to construct. + private TuneModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TuneModelRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TuneModelRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TuneModelRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.TuneModelRequest.class, + com.google.cloud.retail.v2beta.TuneModelRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the model to tune.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the model to tune.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = 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(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.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.TuneModelRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.TuneModelRequest other = + (com.google.cloud.retail.v2beta.TuneModelRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.TuneModelRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.TuneModelRequest 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.TuneModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.TuneModelRequest 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.TuneModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.TuneModelRequest 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.TuneModelRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.TuneModelRequest 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.TuneModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.TuneModelRequest 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.TuneModelRequest 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.TuneModelRequest 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.TuneModelRequest 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 to manually start a tuning process now (instead of waiting for
+   * the periodically scheduled tuning to happen).
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.TuneModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.TuneModelRequest) + com.google.cloud.retail.v2beta.TuneModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.TuneModelRequest.class, + com.google.cloud.retail.v2beta.TuneModelRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.TuneModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.TuneModelRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.TuneModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.TuneModelRequest build() { + com.google.cloud.retail.v2beta.TuneModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.TuneModelRequest buildPartial() { + com.google.cloud.retail.v2beta.TuneModelRequest result = + new com.google.cloud.retail.v2beta.TuneModelRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @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.TuneModelRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.TuneModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.TuneModelRequest other) { + if (other == com.google.cloud.retail.v2beta.TuneModelRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.TuneModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.TuneModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the model to tune.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the model to tune.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the model to tune.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the model to tune.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the model to tune.
+     * Format:
+     * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + 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.TuneModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.TuneModelRequest) + private static final com.google.cloud.retail.v2beta.TuneModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.TuneModelRequest(); + } + + public static com.google.cloud.retail.v2beta.TuneModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TuneModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TuneModelRequest(input, extensionRegistry); + } + }; + + 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.TuneModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelRequestOrBuilder.java new file mode 100644 index 000000000000..085a6422f7d9 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public interface TuneModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.TuneModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the model to tune.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the model to tune.
+   * Format:
+   * `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelResponse.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelResponse.java new file mode 100644 index 000000000000..7b442e77c7b2 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelResponse.java @@ -0,0 +1,457 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Response associated with a tune operation.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.TuneModelResponse} + */ +public final class TuneModelResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.TuneModelResponse) + TuneModelResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use TuneModelResponse.newBuilder() to construct. + private TuneModelResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TuneModelResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TuneModelResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TuneModelResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.TuneModelResponse.class, + com.google.cloud.retail.v2beta.TuneModelResponse.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.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.TuneModelResponse)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.TuneModelResponse other = + (com.google.cloud.retail.v2beta.TuneModelResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.TuneModelResponse parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.TuneModelResponse 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.TuneModelResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.TuneModelResponse 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.TuneModelResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.TuneModelResponse 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.TuneModelResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.TuneModelResponse 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.TuneModelResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.TuneModelResponse 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.TuneModelResponse 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.TuneModelResponse 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.TuneModelResponse 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 associated with a tune operation.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.TuneModelResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.TuneModelResponse) + com.google.cloud.retail.v2beta.TuneModelResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.TuneModelResponse.class, + com.google.cloud.retail.v2beta.TuneModelResponse.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.TuneModelResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_TuneModelResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.TuneModelResponse getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.TuneModelResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.TuneModelResponse build() { + com.google.cloud.retail.v2beta.TuneModelResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.TuneModelResponse buildPartial() { + com.google.cloud.retail.v2beta.TuneModelResponse result = + new com.google.cloud.retail.v2beta.TuneModelResponse(this); + onBuilt(); + return result; + } + + @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.TuneModelResponse) { + return mergeFrom((com.google.cloud.retail.v2beta.TuneModelResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.TuneModelResponse other) { + if (other == com.google.cloud.retail.v2beta.TuneModelResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.TuneModelResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.retail.v2beta.TuneModelResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.TuneModelResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.TuneModelResponse) + private static final com.google.cloud.retail.v2beta.TuneModelResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.TuneModelResponse(); + } + + public static com.google.cloud.retail.v2beta.TuneModelResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TuneModelResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TuneModelResponse(input, extensionRegistry); + } + }; + + 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.TuneModelResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelResponseOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelResponseOrBuilder.java new file mode 100644 index 000000000000..080c145031eb --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/TuneModelResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public interface TuneModelResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.TuneModelResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateModelRequest.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateModelRequest.java new file mode 100644 index 000000000000..2e1a4d5d7e93 --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateModelRequest.java @@ -0,0 +1,1049 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +/** + * + * + *
+ * Request for updating an existing model.
+ * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateModelRequest} + */ +public final class UpdateModelRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.retail.v2beta.UpdateModelRequest) + UpdateModelRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateModelRequest.newBuilder() to construct. + private UpdateModelRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateModelRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateModelRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateModelRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.retail.v2beta.Model.Builder subBuilder = null; + if (model_ != null) { + subBuilder = model_.toBuilder(); + } + model_ = + input.readMessage( + com.google.cloud.retail.v2beta.Model.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(model_); + model_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateModelRequest.class, + com.google.cloud.retail.v2beta.UpdateModelRequest.Builder.class); + } + + public static final int MODEL_FIELD_NUMBER = 1; + private com.google.cloud.retail.v2beta.Model model_; + /** + * + * + *
+   * Required. The body of the updated
+   * [Model][google.cloud.retail.v2beta.Model].
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the model field is set. + */ + @java.lang.Override + public boolean hasModel() { + return model_ != null; + } + /** + * + * + *
+   * Required. The body of the updated
+   * [Model][google.cloud.retail.v2beta.Model].
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The model. + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.Model getModel() { + return model_ == null ? com.google.cloud.retail.v2beta.Model.getDefaultInstance() : model_; + } + /** + * + * + *
+   * Required. The body of the updated
+   * [Model][google.cloud.retail.v2beta.Model].
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.retail.v2beta.ModelOrBuilder getModelOrBuilder() { + return getModel(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'model' to
+   * update. If not set, by default updates all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'model' to
+   * update. If not set, by default updates all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'model' to
+   * update. If not set, by default updates all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (model_ != null) { + output.writeMessage(1, getModel()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (model_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getModel()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + size += unknownFields.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.UpdateModelRequest)) { + return super.equals(obj); + } + com.google.cloud.retail.v2beta.UpdateModelRequest other = + (com.google.cloud.retail.v2beta.UpdateModelRequest) obj; + + if (hasModel() != other.hasModel()) return false; + if (hasModel()) { + if (!getModel().equals(other.getModel())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasModel()) { + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.retail.v2beta.UpdateModelRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateModelRequest 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.UpdateModelRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateModelRequest 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.UpdateModelRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.retail.v2beta.UpdateModelRequest 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.UpdateModelRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateModelRequest 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.UpdateModelRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.retail.v2beta.UpdateModelRequest 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.UpdateModelRequest 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.UpdateModelRequest 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.UpdateModelRequest 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 for updating an existing model.
+   * 
+ * + * Protobuf type {@code google.cloud.retail.v2beta.UpdateModelRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2beta.UpdateModelRequest) + com.google.cloud.retail.v2beta.UpdateModelRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateModelRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateModelRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.retail.v2beta.UpdateModelRequest.class, + com.google.cloud.retail.v2beta.UpdateModelRequest.Builder.class); + } + + // Construct using com.google.cloud.retail.v2beta.UpdateModelRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (modelBuilder_ == null) { + model_ = null; + } else { + model_ = null; + modelBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.retail.v2beta.ModelServiceProto + .internal_static_google_cloud_retail_v2beta_UpdateModelRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateModelRequest getDefaultInstanceForType() { + return com.google.cloud.retail.v2beta.UpdateModelRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateModelRequest build() { + com.google.cloud.retail.v2beta.UpdateModelRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.retail.v2beta.UpdateModelRequest buildPartial() { + com.google.cloud.retail.v2beta.UpdateModelRequest result = + new com.google.cloud.retail.v2beta.UpdateModelRequest(this); + if (modelBuilder_ == null) { + result.model_ = model_; + } else { + result.model_ = modelBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @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.UpdateModelRequest) { + return mergeFrom((com.google.cloud.retail.v2beta.UpdateModelRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.retail.v2beta.UpdateModelRequest other) { + if (other == com.google.cloud.retail.v2beta.UpdateModelRequest.getDefaultInstance()) + return this; + if (other.hasModel()) { + mergeModel(other.getModel()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + com.google.cloud.retail.v2beta.UpdateModelRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.retail.v2beta.UpdateModelRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.retail.v2beta.Model model_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Model, + com.google.cloud.retail.v2beta.Model.Builder, + com.google.cloud.retail.v2beta.ModelOrBuilder> + modelBuilder_; + /** + * + * + *
+     * Required. The body of the updated
+     * [Model][google.cloud.retail.v2beta.Model].
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the model field is set. + */ + public boolean hasModel() { + return modelBuilder_ != null || model_ != null; + } + /** + * + * + *
+     * Required. The body of the updated
+     * [Model][google.cloud.retail.v2beta.Model].
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The model. + */ + public com.google.cloud.retail.v2beta.Model getModel() { + if (modelBuilder_ == null) { + return model_ == null ? com.google.cloud.retail.v2beta.Model.getDefaultInstance() : model_; + } else { + return modelBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The body of the updated
+     * [Model][google.cloud.retail.v2beta.Model].
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setModel(com.google.cloud.retail.v2beta.Model value) { + if (modelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + model_ = value; + onChanged(); + } else { + modelBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The body of the updated
+     * [Model][google.cloud.retail.v2beta.Model].
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setModel(com.google.cloud.retail.v2beta.Model.Builder builderForValue) { + if (modelBuilder_ == null) { + model_ = builderForValue.build(); + onChanged(); + } else { + modelBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The body of the updated
+     * [Model][google.cloud.retail.v2beta.Model].
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeModel(com.google.cloud.retail.v2beta.Model value) { + if (modelBuilder_ == null) { + if (model_ != null) { + model_ = + com.google.cloud.retail.v2beta.Model.newBuilder(model_) + .mergeFrom(value) + .buildPartial(); + } else { + model_ = value; + } + onChanged(); + } else { + modelBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The body of the updated
+     * [Model][google.cloud.retail.v2beta.Model].
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearModel() { + if (modelBuilder_ == null) { + model_ = null; + onChanged(); + } else { + model_ = null; + modelBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The body of the updated
+     * [Model][google.cloud.retail.v2beta.Model].
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.Model.Builder getModelBuilder() { + + onChanged(); + return getModelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The body of the updated
+     * [Model][google.cloud.retail.v2beta.Model].
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.retail.v2beta.ModelOrBuilder getModelOrBuilder() { + if (modelBuilder_ != null) { + return modelBuilder_.getMessageOrBuilder(); + } else { + return model_ == null ? com.google.cloud.retail.v2beta.Model.getDefaultInstance() : model_; + } + } + /** + * + * + *
+     * Required. The body of the updated
+     * [Model][google.cloud.retail.v2beta.Model].
+     * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Model, + com.google.cloud.retail.v2beta.Model.Builder, + com.google.cloud.retail.v2beta.ModelOrBuilder> + getModelFieldBuilder() { + if (modelBuilder_ == null) { + modelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.retail.v2beta.Model, + com.google.cloud.retail.v2beta.Model.Builder, + com.google.cloud.retail.v2beta.ModelOrBuilder>( + getModel(), getParentForChildren(), isClean()); + model_ = null; + } + return modelBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'model' to
+     * update. If not set, by default updates all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'model' to
+     * update. If not set, by default updates all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'model' to
+     * update. If not set, by default updates all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'model' to
+     * update. If not set, by default updates all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'model' to
+     * update. If not set, by default updates all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'model' to
+     * update. If not set, by default updates all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'model' to
+     * update. If not set, by default updates all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'model' to
+     * update. If not set, by default updates all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. Indicates which fields in the provided 'model' to
+     * update. If not set, by default updates all fields.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.UpdateModelRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.retail.v2beta.UpdateModelRequest) + private static final com.google.cloud.retail.v2beta.UpdateModelRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.retail.v2beta.UpdateModelRequest(); + } + + public static com.google.cloud.retail.v2beta.UpdateModelRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateModelRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateModelRequest(input, extensionRegistry); + } + }; + + 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.UpdateModelRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateModelRequestOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateModelRequestOrBuilder.java new file mode 100644 index 000000000000..b9db7fd3f47d --- /dev/null +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UpdateModelRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2020 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/model_service.proto + +package com.google.cloud.retail.v2beta; + +public interface UpdateModelRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2beta.UpdateModelRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The body of the updated
+   * [Model][google.cloud.retail.v2beta.Model].
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the model field is set. + */ + boolean hasModel(); + /** + * + * + *
+   * Required. The body of the updated
+   * [Model][google.cloud.retail.v2beta.Model].
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The model. + */ + com.google.cloud.retail.v2beta.Model getModel(); + /** + * + * + *
+   * Required. The body of the updated
+   * [Model][google.cloud.retail.v2beta.Model].
+   * 
+ * + * .google.cloud.retail.v2beta.Model model = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.retail.v2beta.ModelOrBuilder getModelOrBuilder(); + + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'model' to
+   * update. If not set, by default updates all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'model' to
+   * update. If not set, by default updates all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. Indicates which fields in the provided 'model' to
+   * update. If not set, by default updates all fields.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEvent.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEvent.java index ac7828cd971b..f55848a6a324 100644 --- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEvent.java +++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEvent.java @@ -1446,7 +1446,7 @@ public int getOffset() { *
    * The categories associated with a category page.
    * To represent full path of category, use '>' sign to separate different
-   * hierarchies. If '>' is part of the category name, please replace it with
+   * hierarchies. If '>' is part of the category name, replace it with
    * other character(s).
    * Category pages include special pages such as sales or promotions. For
    * instance, a special sale page may have the category hierarchy:
@@ -1471,7 +1471,7 @@ public com.google.protobuf.ProtocolStringList getPageCategoriesList() {
    * 
    * The categories associated with a category page.
    * To represent full path of category, use '>' sign to separate different
-   * hierarchies. If '>' is part of the category name, please replace it with
+   * hierarchies. If '>' is part of the category name, replace it with
    * other character(s).
    * Category pages include special pages such as sales or promotions. For
    * instance, a special sale page may have the category hierarchy:
@@ -1496,7 +1496,7 @@ public int getPageCategoriesCount() {
    * 
    * The categories associated with a category page.
    * To represent full path of category, use '>' sign to separate different
-   * hierarchies. If '>' is part of the category name, please replace it with
+   * hierarchies. If '>' is part of the category name, replace it with
    * other character(s).
    * Category pages include special pages such as sales or promotions. For
    * instance, a special sale page may have the category hierarchy:
@@ -1522,7 +1522,7 @@ public java.lang.String getPageCategories(int index) {
    * 
    * The categories associated with a category page.
    * To represent full path of category, use '>' sign to separate different
-   * hierarchies. If '>' is part of the category name, please replace it with
+   * hierarchies. If '>' is part of the category name, replace it with
    * other character(s).
    * Category pages include special pages such as sales or promotions. For
    * instance, a special sale page may have the category hierarchy:
@@ -5484,7 +5484,7 @@ private void ensurePageCategoriesIsMutable() {
      * 
      * The categories associated with a category page.
      * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
+     * hierarchies. If '>' is part of the category name, replace it with
      * other character(s).
      * Category pages include special pages such as sales or promotions. For
      * instance, a special sale page may have the category hierarchy:
@@ -5509,7 +5509,7 @@ public com.google.protobuf.ProtocolStringList getPageCategoriesList() {
      * 
      * The categories associated with a category page.
      * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
+     * hierarchies. If '>' is part of the category name, replace it with
      * other character(s).
      * Category pages include special pages such as sales or promotions. For
      * instance, a special sale page may have the category hierarchy:
@@ -5534,7 +5534,7 @@ public int getPageCategoriesCount() {
      * 
      * The categories associated with a category page.
      * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
+     * hierarchies. If '>' is part of the category name, replace it with
      * other character(s).
      * Category pages include special pages such as sales or promotions. For
      * instance, a special sale page may have the category hierarchy:
@@ -5560,7 +5560,7 @@ public java.lang.String getPageCategories(int index) {
      * 
      * The categories associated with a category page.
      * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
+     * hierarchies. If '>' is part of the category name, replace it with
      * other character(s).
      * Category pages include special pages such as sales or promotions. For
      * instance, a special sale page may have the category hierarchy:
@@ -5586,7 +5586,7 @@ public com.google.protobuf.ByteString getPageCategoriesBytes(int index) {
      * 
      * The categories associated with a category page.
      * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
+     * hierarchies. If '>' is part of the category name, replace it with
      * other character(s).
      * Category pages include special pages such as sales or promotions. For
      * instance, a special sale page may have the category hierarchy:
@@ -5619,7 +5619,7 @@ public Builder setPageCategories(int index, java.lang.String value) {
      * 
      * The categories associated with a category page.
      * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
+     * hierarchies. If '>' is part of the category name, replace it with
      * other character(s).
      * Category pages include special pages such as sales or promotions. For
      * instance, a special sale page may have the category hierarchy:
@@ -5651,7 +5651,7 @@ public Builder addPageCategories(java.lang.String value) {
      * 
      * The categories associated with a category page.
      * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
+     * hierarchies. If '>' is part of the category name, replace it with
      * other character(s).
      * Category pages include special pages such as sales or promotions. For
      * instance, a special sale page may have the category hierarchy:
@@ -5680,7 +5680,7 @@ public Builder addAllPageCategories(java.lang.Iterable values)
      * 
      * The categories associated with a category page.
      * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
+     * hierarchies. If '>' is part of the category name, replace it with
      * other character(s).
      * Category pages include special pages such as sales or promotions. For
      * instance, a special sale page may have the category hierarchy:
@@ -5708,7 +5708,7 @@ public Builder clearPageCategories() {
      * 
      * The categories associated with a category page.
      * To represent full path of category, use '>' sign to separate different
-     * hierarchies. If '>' is part of the category name, please replace it with
+     * hierarchies. If '>' is part of the category name, replace it with
      * other character(s).
      * Category pages include special pages such as sales or promotions. For
      * instance, a special sale page may have the category hierarchy:
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventOrBuilder.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventOrBuilder.java
index 7f39e4b66dbc..d491e0951246 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventOrBuilder.java
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventOrBuilder.java
@@ -835,7 +835,7 @@ com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault(
    * 
    * The categories associated with a category page.
    * To represent full path of category, use '>' sign to separate different
-   * hierarchies. If '>' is part of the category name, please replace it with
+   * hierarchies. If '>' is part of the category name, replace it with
    * other character(s).
    * Category pages include special pages such as sales or promotions. For
    * instance, a special sale page may have the category hierarchy:
@@ -858,7 +858,7 @@ com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault(
    * 
    * The categories associated with a category page.
    * To represent full path of category, use '>' sign to separate different
-   * hierarchies. If '>' is part of the category name, please replace it with
+   * hierarchies. If '>' is part of the category name, replace it with
    * other character(s).
    * Category pages include special pages such as sales or promotions. For
    * instance, a special sale page may have the category hierarchy:
@@ -881,7 +881,7 @@ com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault(
    * 
    * The categories associated with a category page.
    * To represent full path of category, use '>' sign to separate different
-   * hierarchies. If '>' is part of the category name, please replace it with
+   * hierarchies. If '>' is part of the category name, replace it with
    * other character(s).
    * Category pages include special pages such as sales or promotions. For
    * instance, a special sale page may have the category hierarchy:
@@ -905,7 +905,7 @@ com.google.cloud.retail.v2beta.CustomAttribute getAttributesOrDefault(
    * 
    * The categories associated with a category page.
    * To represent full path of category, use '>' sign to separate different
-   * hierarchies. If '>' is part of the category name, please replace it with
+   * hierarchies. If '>' is part of the category name, replace it with
    * other character(s).
    * Category pages include special pages such as sales or promotions. For
    * instance, a special sale page may have the category hierarchy:
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceProto.java b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceProto.java
index 0c9207db606d..b8802e9ae807 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceProto.java
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/java/com/google/cloud/retail/v2beta/UserEventServiceProto.java
@@ -60,64 +60,64 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
           + "service.proto\022\032google.cloud.retail.v2bet"
           + "a\032\034google/api/annotations.proto\032\027google/"
           + "api/client.proto\032\037google/api/field_behav"
-          + "ior.proto\032\031google/api/httpbody.proto\032.go"
-          + "ogle/cloud/retail/v2beta/import_config.p"
-          + "roto\032-google/cloud/retail/v2beta/purge_c"
-          + "onfig.proto\032+google/cloud/retail/v2beta/"
-          + "user_event.proto\032#google/longrunning/ope"
-          + "rations.proto\"l\n\025WriteUserEventRequest\022\023"
-          + "\n\006parent\030\001 \001(\tB\003\340A\002\022>\n\nuser_event\030\002 \001(\0132"
-          + "%.google.cloud.retail.v2beta.UserEventB\003"
-          + "\340A\002\"a\n\027CollectUserEventRequest\022\023\n\006parent"
-          + "\030\001 \001(\tB\003\340A\002\022\027\n\nuser_event\030\002 \001(\tB\003\340A\002\022\013\n\003"
-          + "uri\030\003 \001(\t\022\013\n\003ets\030\004 \001(\003\"\202\002\n\027RejoinUserEve"
-          + "ntsRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022i\n\027user_"
-          + "event_rejoin_scope\030\002 \001(\0162H.google.cloud."
-          + "retail.v2beta.RejoinUserEventsRequest.Us"
-          + "erEventRejoinScope\"g\n\024UserEventRejoinSco"
-          + "pe\022\'\n#USER_EVENT_REJOIN_SCOPE_UNSPECIFIE"
-          + "D\020\000\022\021\n\rJOINED_EVENTS\020\001\022\023\n\017UNJOINED_EVENT"
-          + "S\020\002\">\n\030RejoinUserEventsResponse\022\"\n\032rejoi"
-          + "ned_user_events_count\030\001 \001(\003\"\032\n\030RejoinUse"
-          + "rEventsMetadata2\373\t\n\020UserEventService\022\303\001\n"
-          + "\016WriteUserEvent\0221.google.cloud.retail.v2"
-          + "beta.WriteUserEventRequest\032%.google.clou"
-          + "d.retail.v2beta.UserEvent\"W\202\323\344\223\002Q\"C/v2be"
-          + "ta/{parent=projects/*/locations/*/catalo"
-          + "gs/*}/userEvents:write:\nuser_event\022\254\001\n\020C"
-          + "ollectUserEvent\0223.google.cloud.retail.v2"
-          + "beta.CollectUserEventRequest\032\024.google.ap"
-          + "i.HttpBody\"M\202\323\344\223\002G\022E/v2beta/{parent=proj"
-          + "ects/*/locations/*/catalogs/*}/userEvent"
-          + "s:collect\022\226\002\n\017PurgeUserEvents\0222.google.c"
-          + "loud.retail.v2beta.PurgeUserEventsReques"
-          + "t\032\035.google.longrunning.Operation\"\257\001\202\323\344\223\002"
-          + "H\"C/v2beta/{parent=projects/*/locations/"
-          + "*/catalogs/*}/userEvents:purge:\001*\312A^\n2go"
-          + "ogle.cloud.retail.v2beta.PurgeUserEvents"
-          + "Response\022(google.cloud.retail.v2beta.Pur"
-          + "geMetadata\022\233\002\n\020ImportUserEvents\0223.google"
-          + ".cloud.retail.v2beta.ImportUserEventsReq"
-          + "uest\032\035.google.longrunning.Operation\"\262\001\202\323"
-          + "\344\223\002I\"D/v2beta/{parent=projects/*/locatio"
-          + "ns/*/catalogs/*}/userEvents:import:\001*\312A`"
-          + "\n3google.cloud.retail.v2beta.ImportUserE"
-          + "ventsResponse\022)google.cloud.retail.v2bet"
-          + "a.ImportMetadata\022\357\001\n\020RejoinUserEvents\0223."
-          + "google.cloud.retail.v2beta.RejoinUserEve"
-          + "ntsRequest\032\035.google.longrunning.Operatio"
-          + "n\"\206\001\202\323\344\223\002I\"D/v2beta/{parent=projects/*/l"
-          + "ocations/*/catalogs/*}/userEvents:rejoin"
-          + ":\001*\312A4\n\030RejoinUserEventsResponse\022\030Rejoin"
-          + "UserEventsMetadata\032I\312A\025retail.googleapis"
-          + ".com\322A.https://www.googleapis.com/auth/c"
-          + "loud-platformB\336\001\n\036com.google.cloud.retai"
-          + "l.v2betaB\025UserEventServiceProtoP\001Z@googl"
-          + "e.golang.org/genproto/googleapis/cloud/r"
-          + "etail/v2beta;retail\242\002\006RETAIL\252\002\032Google.Cl"
-          + "oud.Retail.V2Beta\312\002\032Google\\Cloud\\Retail\\"
-          + "V2beta\352\002\035Google::Cloud::Retail::V2betab\006"
-          + "proto3"
+          + "ior.proto\032\031google/api/httpbody.proto\032\031go"
+          + "ogle/api/resource.proto\032.google/cloud/re"
+          + "tail/v2beta/import_config.proto\032-google/"
+          + "cloud/retail/v2beta/purge_config.proto\032+"
+          + "google/cloud/retail/v2beta/user_event.pr"
+          + "oto\032#google/longrunning/operations.proto"
+          + "\"l\n\025WriteUserEventRequest\022\023\n\006parent\030\001 \001("
+          + "\tB\003\340A\002\022>\n\nuser_event\030\002 \001(\0132%.google.clou"
+          + "d.retail.v2beta.UserEventB\003\340A\002\"a\n\027Collec"
+          + "tUserEventRequest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\027"
+          + "\n\nuser_event\030\002 \001(\tB\003\340A\002\022\013\n\003uri\030\003 \001(\t\022\013\n\003"
+          + "ets\030\004 \001(\003\"\202\002\n\027RejoinUserEventsRequest\022\023\n"
+          + "\006parent\030\001 \001(\tB\003\340A\002\022i\n\027user_event_rejoin_"
+          + "scope\030\002 \001(\0162H.google.cloud.retail.v2beta"
+          + ".RejoinUserEventsRequest.UserEventRejoin"
+          + "Scope\"g\n\024UserEventRejoinScope\022\'\n#USER_EV"
+          + "ENT_REJOIN_SCOPE_UNSPECIFIED\020\000\022\021\n\rJOINED"
+          + "_EVENTS\020\001\022\023\n\017UNJOINED_EVENTS\020\002\">\n\030Rejoin"
+          + "UserEventsResponse\022\"\n\032rejoined_user_even"
+          + "ts_count\030\001 \001(\003\"\032\n\030RejoinUserEventsMetada"
+          + "ta2\373\t\n\020UserEventService\022\303\001\n\016WriteUserEve"
+          + "nt\0221.google.cloud.retail.v2beta.WriteUse"
+          + "rEventRequest\032%.google.cloud.retail.v2be"
+          + "ta.UserEvent\"W\202\323\344\223\002Q\"C/v2beta/{parent=pr"
+          + "ojects/*/locations/*/catalogs/*}/userEve"
+          + "nts:write:\nuser_event\022\254\001\n\020CollectUserEve"
+          + "nt\0223.google.cloud.retail.v2beta.CollectU"
+          + "serEventRequest\032\024.google.api.HttpBody\"M\202"
+          + "\323\344\223\002G\022E/v2beta/{parent=projects/*/locati"
+          + "ons/*/catalogs/*}/userEvents:collect\022\226\002\n"
+          + "\017PurgeUserEvents\0222.google.cloud.retail.v"
+          + "2beta.PurgeUserEventsRequest\032\035.google.lo"
+          + "ngrunning.Operation\"\257\001\202\323\344\223\002H\"C/v2beta/{p"
+          + "arent=projects/*/locations/*/catalogs/*}"
+          + "/userEvents:purge:\001*\312A^\n2google.cloud.re"
+          + "tail.v2beta.PurgeUserEventsResponse\022(goo"
+          + "gle.cloud.retail.v2beta.PurgeMetadata\022\233\002"
+          + "\n\020ImportUserEvents\0223.google.cloud.retail"
+          + ".v2beta.ImportUserEventsRequest\032\035.google"
+          + ".longrunning.Operation\"\262\001\202\323\344\223\002I\"D/v2beta"
+          + "/{parent=projects/*/locations/*/catalogs"
+          + "/*}/userEvents:import:\001*\312A`\n3google.clou"
+          + "d.retail.v2beta.ImportUserEventsResponse"
+          + "\022)google.cloud.retail.v2beta.ImportMetad"
+          + "ata\022\357\001\n\020RejoinUserEvents\0223.google.cloud."
+          + "retail.v2beta.RejoinUserEventsRequest\032\035."
+          + "google.longrunning.Operation\"\206\001\202\323\344\223\002I\"D/"
+          + "v2beta/{parent=projects/*/locations/*/ca"
+          + "talogs/*}/userEvents:rejoin:\001*\312A4\n\030Rejoi"
+          + "nUserEventsResponse\022\030RejoinUserEventsMet"
+          + "adata\032I\312A\025retail.googleapis.com\322A.https:"
+          + "//www.googleapis.com/auth/cloud-platform"
+          + "B\336\001\n\036com.google.cloud.retail.v2betaB\025Use"
+          + "rEventServiceProtoP\001Z@google.golang.org/"
+          + "genproto/googleapis/cloud/retail/v2beta;"
+          + "retail\242\002\006RETAIL\252\002\032Google.Cloud.Retail.V2"
+          + "Beta\312\002\032Google\\Cloud\\Retail\\V2beta\352\002\035Goog"
+          + "le::Cloud::Retail::V2betab\006proto3"
     };
     descriptor =
         com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -127,6 +127,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
               com.google.api.ClientProto.getDescriptor(),
               com.google.api.FieldBehaviorProto.getDescriptor(),
               com.google.api.HttpBodyProto.getDescriptor(),
+              com.google.api.ResourceProto.getDescriptor(),
               com.google.cloud.retail.v2beta.ImportConfigProto.getDescriptor(),
               com.google.cloud.retail.v2beta.PurgeConfigProto.getDescriptor(),
               com.google.cloud.retail.v2beta.UserEventProto.getDescriptor(),
@@ -183,6 +184,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
     com.google.api.ClientProto.getDescriptor();
     com.google.api.FieldBehaviorProto.getDescriptor();
     com.google.api.HttpBodyProto.getDescriptor();
+    com.google.api.ResourceProto.getDescriptor();
     com.google.cloud.retail.v2beta.ImportConfigProto.getDescriptor();
     com.google.cloud.retail.v2beta.PurgeConfigProto.getDescriptor();
     com.google.cloud.retail.v2beta.UserEventProto.getDescriptor();
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog.proto
index 0c2cab63c10d..c95e3ac93403 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog.proto
@@ -141,6 +141,19 @@ message CatalogAttribute {
     SEARCHABLE_DISABLED = 2;
   }
 
+  // The status of the exact-searchable option of a catalog attribute.
+  enum ExactSearchableOption {
+    // Value used when unset. Defaults to
+    // [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2beta.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED].
+    EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0;
+
+    // Exact searchable option enabled for an attribute.
+    EXACT_SEARCHABLE_ENABLED = 1;
+
+    // Exact searchable option disabled for an attribute.
+    EXACT_SEARCHABLE_DISABLED = 2;
+  }
+
   // Required. Attribute name.
   // For example: `color`, `brands`, `attributes.custom_attribute`, such as
   // `attributes.xyz`.
@@ -211,6 +224,11 @@ message CatalogAttribute {
   // This option works for categorical features only,
   // does not work for numerical features, inventory filtering.
   RecommendationsFilteringOption recommendations_filtering_option = 8;
+
+  // If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable.
+  // This property only applies to textual custom attributes and requires
+  // indexable set to enabled to enable exact-searchable.
+  ExactSearchableOption exact_searchable_option = 11;
 }
 
 // Catalog level attribute config.
@@ -348,8 +366,8 @@ message MerchantCenterLink {
   string branch_id = 2;
 
   // String representing the destination to import for, all if left empty.
-  // List of possible values can be found here.
-  // [https://support.google.com/merchants/answer/7501026]
+  // List of possible values is given in [Included
+  // destination](https://support.google.com/merchants/answer/7501026).
   // List of allowed string values:
   // "Shopping_ads", "Buy_on_google_listings", "Display_ads", "Local_inventory
   // _ads", "Free_listings", "Free_local_listings"
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog_service.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog_service.proto
index fb6f8bca0f0e..7001c211324f 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog_service.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/catalog_service.proto
@@ -186,6 +186,17 @@ service CatalogService {
     };
   }
 
+  // Removes all specified
+  // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s from the
+  // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].
+  rpc BatchRemoveCatalogAttributes(BatchRemoveCatalogAttributesRequest)
+      returns (BatchRemoveCatalogAttributesResponse) {
+    option (google.api.http) = {
+      post: "/v2beta/{attributes_config=projects/*/locations/*/catalogs/*/attributesConfig}:batchRemoveCatalogAttributes"
+      body: "*"
+    };
+  }
+
   // Replaces the specified
   // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the
   // [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating
@@ -341,7 +352,7 @@ message GetDefaultBranchResponse {
 // method.
 message GetCompletionConfigRequest {
   // Required. Full CompletionConfig resource name. Format:
-  // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/completionConfig`
   string name = 1 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.resource_reference) = {
@@ -449,6 +460,39 @@ message RemoveCatalogAttributeRequest {
   string key = 2 [(google.api.field_behavior) = REQUIRED];
 }
 
+// Request for
+// [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2beta.CatalogService.BatchRemoveCatalogAttributes]
+// method.
+message BatchRemoveCatalogAttributesRequest {
+  // Required. The attributes config resource shared by all catalog attributes
+  // being deleted. Format:
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/attributesConfig`
+  string attributes_config = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = {
+      type: "retail.googleapis.com/AttributesConfig"
+    }
+  ];
+
+  // Required. The attribute name keys of the
+  // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s to delete.
+  // A maximum of 1000 catalog attributes can be deleted in a batch.
+  repeated string attribute_keys = 2 [(google.api.field_behavior) = REQUIRED];
+}
+
+// Response of the
+// [CatalogService.BatchRemoveCatalogAttributes][google.cloud.retail.v2beta.CatalogService.BatchRemoveCatalogAttributes].
+message BatchRemoveCatalogAttributesResponse {
+  // Catalog attributes that were deleted. Only attributes that are not [in
+  // use][CatalogAttribute.in_use] by products can be deleted.
+  repeated string deleted_catalog_attributes = 1;
+
+  // Catalog attributes that were reset. Attributes that are [in
+  // use][CatalogAttribute.in_use] by products cannot be deleted, however their
+  // configuration properties will reset to default values upon removal request.
+  repeated string reset_catalog_attributes = 2;
+}
+
 // Request for
 // [CatalogService.ReplaceCatalogAttribute][google.cloud.retail.v2beta.CatalogService.ReplaceCatalogAttribute]
 // method.
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/common.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/common.proto
index 3a500afc5868..fd1247636b4a 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/common.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/common.proto
@@ -72,7 +72,7 @@ enum RecommendationsFilteringOption {
 // The use case of Cloud Retail Search.
 enum SearchSolutionUseCase {
   // The value when it's unspecified. In this case, server behavior defaults to
-  // [SEARCH_SOLUTION_USE_CASE_SEARCH][].
+  // [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH].
   SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0;
 
   // Search use case. Expects the traffic has a non-empty
@@ -97,8 +97,8 @@ message Condition {
     // Value cannot be empty.
     // Value can have at most 3 terms if specified as a partial match. Each
     // space separated string is considered as one term.
-    // Example) "a b c" is 3 terms and allowed, " a b c d" is 4 terms and not
-    // allowed for partial match.
+    // For example, "a b c" is 3 terms and allowed, but " a b c d" is 4 terms
+    // and not allowed for a partial match.
     string value = 1;
 
     // Whether this is supposed to be a full or partial match.
@@ -127,10 +127,12 @@ message Condition {
 }
 
 // A rule is a condition-action pair
+//
 // * A condition defines when a rule is to be triggered.
 // * An action specifies what occurs on that trigger.
-// Currently only boost rules are supported.
-// Currently only supported by the search endpoint.
+// Currently rules only work for [controls][google.cloud.retail.v2beta.Control]
+// with
+// [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
 message Rule {
   // A boost action to apply to results matching condition specified above.
   message BoostAction {
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/completion_service.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/completion_service.proto
index 0d6480a1a2e5..4db036647f97 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/completion_service.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/completion_service.proto
@@ -36,7 +36,7 @@ option ruby_package = "Google::Cloud::Retail::V2beta";
 // Auto-completion service for retail.
 //
 // This feature is only available for users who have Retail Search enabled.
-// Please enable Retail Search on Cloud Console before using this feature.
+// Enable Retail Search on Cloud Console before using this feature.
 service CompletionService {
   option (google.api.default_host) = "retail.googleapis.com";
   option (google.api.oauth_scopes) =
@@ -45,7 +45,7 @@ service CompletionService {
   // Completes the specified prefix with keyword suggestions.
   //
   // This feature is only available for users who have Retail Search enabled.
-  // Please enable Retail Search on Cloud Console before using this feature.
+  // Enable Retail Search on Cloud Console before using this feature.
   rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) {
     option (google.api.http) = {
       get: "/v2beta/{catalog=projects/*/locations/*/catalogs/*}:completeQuery"
@@ -60,7 +60,7 @@ service CompletionService {
   // are indexed successfully and ready for serving. The process takes hours.
   //
   // This feature is only available for users who have Retail Search enabled.
-  // Please enable Retail Search on Cloud Console before using this feature.
+  // Enable Retail Search on Cloud Console before using this feature.
   rpc ImportCompletionData(ImportCompletionDataRequest)
       returns (google.longrunning.Operation) {
     option (google.api.http) = {
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control.proto
index 2cd59be4b7e2..238f0f5fe69e 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control.proto
@@ -30,8 +30,9 @@ option objc_class_prefix = "RETAIL";
 option php_namespace = "Google\\Cloud\\Retail\\V2beta";
 option ruby_package = "Google::Cloud::Retail::V2beta";
 
-// Configures dynamic serving time metadata that is used to pre and post
-// process search/recommendation model results.
+// Configures dynamic metadata that can be linked to a
+// [ServingConfig][google.cloud.retail.v2beta.ServingConfig] and affect search
+// or recommendation results at serving time.
 message Control {
   option (google.api.resource) = {
     type: "retail.googleapis.com/Control"
@@ -45,7 +46,10 @@ message Control {
   // INVALID_ARGUMENT will be returned if either condition is violated.
   oneof control {
     // A facet specification to perform faceted search.
-    SearchRequest.FacetSpec facet_spec = 3;
+    //
+    // Note that this field is deprecated and will throw NOT_IMPLEMENTED if
+    // used for creating a control.
+    SearchRequest.FacetSpec facet_spec = 3 [deprecated = true];
 
     // A rule control - a condition-action pair.
     // Enacts a set action when the condition is triggered.
@@ -63,22 +67,34 @@ message Control {
   // characters. Otherwise, an INVALID_ARGUMENT error is thrown.
   string display_name = 2 [(google.api.field_behavior) = REQUIRED];
 
-  // Output only. List of serving configuration ids that that are associated
-  // with this control. Note the association is managed via the ServingConfig,
-  // this is an output only denormalizeed  view. Assumed to be in the same
-  // catalog.
+  // Output only. List of [serving
+  // configuration][google.cloud.retail.v2beta.ServingConfig] ids that are
+  // associated with this control in the same
+  // [Catalog][google.cloud.retail.v2beta.Catalog].
+  //
+  // Note the association is managed via the
+  // [ServingConfig][google.cloud.retail.v2beta.ServingConfig], this is an
+  // output only denormalized view.
   repeated string associated_serving_config_ids = 5
       [(google.api.field_behavior) = OUTPUT_ONLY];
 
-  // Required. Immutable. The solution types that the serving config is used
-  // for. Currently we support setting only one type of solution at creation
-  // time.
+  // Required. Immutable. The solution types that the control is used for.
+  // Currently we support setting only one type of solution at creation time.
   //
   // Only `SOLUTION_TYPE_SEARCH` value is supported at the moment.
   // If no solution type is provided at creation time, will default to
-  // SOLUTION_TYPE_SEARCH.
+  // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2beta.SolutionType.SOLUTION_TYPE_SEARCH].
   repeated SolutionType solution_types = 6 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.field_behavior) = IMMUTABLE
   ];
+
+  // Specifies the use case for the control.
+  // Affects what condition fields can be set.
+  // Only settable by search controls.
+  // Will default to
+  // [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2beta.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH]
+  // if not specified. Currently only allow one search_solution_use_case per
+  // control.
+  repeated SearchSolutionUseCase search_solution_use_case = 7;
 }
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control_service.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control_service.proto
index 3ec62e6c674b..a0a9d2e732fd 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control_service.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/control_service.proto
@@ -66,7 +66,7 @@ service ControlService {
   //
   // [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 delete does not exist, a
+  // [Control][google.cloud.retail.v2beta.Control] to update does not exist, a
   // NOT_FOUND error is returned.
   rpc UpdateControl(UpdateControlRequest) returns (Control) {
     option (google.api.http) = {
@@ -84,7 +84,8 @@ service ControlService {
     option (google.api.method_signature) = "name";
   }
 
-  // Lists all Controls linked to this catalog.
+  // Lists all Controls by their parent
+  // [Catalog][google.cloud.retail.v2beta.Catalog].
   rpc ListControls(ListControlsRequest) returns (ListControlsResponse) {
     option (google.api.http) = {
       get: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/controls"
@@ -140,7 +141,7 @@ message DeleteControlRequest {
 
 // Request for GetControl method.
 message GetControlRequest {
-  // Required. The resource name of the Control to delete. Format:
+  // Required. The resource name of the Control to get. Format:
   // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/controls/{control_id}`
   string name = 1 [
     (google.api.field_behavior) = REQUIRED,
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 52ef46a42e7b..de24f41907ae 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
@@ -16,6 +16,8 @@ syntax = "proto3";
 
 package google.cloud.retail.v2beta;
 
+import "google/api/field_behavior.proto";
+import "google/api/resource.proto";
 import "google/protobuf/timestamp.proto";
 import "google/rpc/status.proto";
 
@@ -40,7 +42,7 @@ message ExportErrorsConfig {
   }
 }
 
-// Metadata related to the progress of the Export operation. This will be
+// Metadata related to the progress of the Export operation. This is
 // returned by the google.longrunning.Operation.metadata field.
 message ExportMetadata {
   // Operation create time.
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/import_config.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/import_config.proto
index 4e53ca636b26..e544f6471a0c 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/import_config.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/import_config.proto
@@ -35,7 +35,6 @@ option php_namespace = "Google\\Cloud\\Retail\\V2beta";
 option ruby_package = "Google::Cloud::Retail::V2beta";
 
 // Google Cloud Storage location for input content.
-// format.
 message GcsSource {
   // Required. Google Cloud Storage URIs to input files. URI can be up to
   // 2000 characters long. URIs can match the full object path (for example,
@@ -66,12 +65,12 @@ message GcsSource {
   //
   // Supported values for control imports:
   //
-  // * 'control' (default): One JSON
+  // * `control` (default): One JSON
   // [Control][google.cloud.retail.v2beta.Control] per line.
   //
   // Supported values for catalog attribute imports:
   //
-  // * 'catalog_attribute' (default): One CSV
+  // * `catalog_attribute` (default): One CSV
   // [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] per line.
   string data_schema = 2;
 }
@@ -83,9 +82,8 @@ message BigQuerySource {
   oneof partition {
     // BigQuery time partitioned table's _PARTITIONDATE in YYYY-MM-DD format.
     //
-    // Only supported when
-    // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-    // is set to `FULL`.
+    // Only supported in
+    // [ImportProductsRequest][google.cloud.retail.v2beta.ImportProductsRequest].
     google.type.Date partition_date = 6;
   }
 
@@ -124,8 +122,7 @@ message BigQuerySource {
   // * `user_event_ga360`:
   //   The schema is available here:
   //   https://support.google.com/analytics/answer/3437719.
-  // * `user_event_ga4`: This feature is in private preview. Please contact the
-  //   support team for importing Google Analytics 4 events.
+  // * `user_event_ga4`:
   //   The schema is available here:
   //   https://support.google.com/analytics/answer/7029846.
   //
@@ -156,7 +153,7 @@ message ImportErrorsConfig {
   // Required. Errors destination.
   oneof destination {
     // Google Cloud Storage prefix for import errors. This must be an empty,
-    // existing Cloud Storage directory. Import errors will be written to
+    // existing Cloud Storage directory. Import errors are written to
     // sharded files in this directory, one per line, as a JSON-encoded
     // `google.rpc.Status` message.
     string gcs_prefix = 1;
@@ -176,16 +173,6 @@ message ImportProductsRequest {
 
     // Calculates diff and replaces the entire product dataset. Existing
     // products may be deleted if they are not present in the source location.
-    //
-    // Can only be set while using
-    // [BigQuerySource][google.cloud.retail.v2beta.BigQuerySource]. And the
-    // BigQuery dataset must be created in the data location "us (multiple
-    // regions in United States)", otherwise a PERMISSION_DENIED error is
-    // thrown.
-    //
-    // Add the IAM permission "BigQuery Data Viewer" for
-    // cloud-retail-customer-data-access@system.gserviceaccount.com before
-    // using this feature otherwise an error is thrown.
     FULL = 2;
   }
 
@@ -208,8 +195,8 @@ message ImportProductsRequest {
   // The desired location of errors incurred during the Import.
   ImportErrorsConfig errors_config = 3;
 
-  // Indicates which fields in the provided imported 'products' to update. If
-  // not set, will by default update all fields.
+  // Indicates which fields in the provided imported `products` to update. If
+  // not set, all fields are updated.
   google.protobuf.FieldMask update_mask = 4;
 
   // The mode of reconciliation between existing products and the products to be
@@ -218,21 +205,16 @@ message ImportProductsRequest {
   ReconciliationMode reconciliation_mode = 5;
 
   // Full Pub/Sub topic name for receiving notification. If this field is set,
-  // when the import is finished, a notification will be sent to
-  // specified Pub/Sub topic. The message data will be JSON string of a
+  // when the import is finished, a notification is sent to
+  // specified Pub/Sub topic. The message data is JSON string of a
   // [Operation][google.longrunning.Operation].
   //
   // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`. It has
   // to be within the same project as
   // [ImportProductsRequest.parent][google.cloud.retail.v2beta.ImportProductsRequest.parent].
-  // Make sure that both
-  // `cloud-retail-customer-data-access@system.gserviceaccount.com` and
-  // `service-@gcp-sa-retail.iam.gserviceaccount.com`
-  // have the `pubsub.topics.publish` IAM permission on the topic.
-  //
-  // Only supported when
-  // [ImportProductsRequest.reconciliation_mode][google.cloud.retail.v2beta.ImportProductsRequest.reconciliation_mode]
-  // is set to `FULL`.
+  // Make sure that `service-@gcp-sa-retail.iam.gserviceaccount.com` has the
+  // `pubsub.topics.publish` IAM permission on the topic.
   string notification_pubsub_topic = 7;
 }
 
@@ -268,8 +250,8 @@ message ImportCompletionDataRequest {
       [(google.api.field_behavior) = REQUIRED];
 
   // Pub/Sub topic for receiving notification. If this field is set,
-  // when the import is finished, a notification will be sent to
-  // specified Pub/Sub topic. The message data will be JSON string of a
+  // when the import is finished, a notification is sent to
+  // specified Pub/Sub topic. The message data is JSON string of a
   // [Operation][google.longrunning.Operation].
   // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
   string notification_pubsub_topic = 3;
@@ -329,7 +311,7 @@ message CompletionDataInputConfig {
   }
 }
 
-// Metadata related to the progress of the Import operation. This will be
+// Metadata related to the progress of the Import operation. This is
 // returned by the google.longrunning.Operation.metadata field.
 message ImportMetadata {
   // Operation create time.
@@ -349,8 +331,8 @@ message ImportMetadata {
   string request_id = 5 [deprecated = true];
 
   // Pub/Sub topic for receiving notification. If this field is set,
-  // when the import is finished, a notification will be sent to
-  // specified Pub/Sub topic. The message data will be JSON string of a
+  // when the import is finished, a notification is sent to
+  // specified Pub/Sub topic. The message data is JSON string of a
   // [Operation][google.longrunning.Operation].
   // Format of the Pub/Sub topic is `projects/{project}/topics/{topic}`.
   string notification_pubsub_topic = 6;
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/model.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/model.proto
new file mode 100644
index 000000000000..ea4bd30c6c97
--- /dev/null
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/model.proto
@@ -0,0 +1,238 @@
+// Copyright 2022 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/field_behavior.proto";
+import "google/api/resource.proto";
+import "google/cloud/retail/v2beta/common.proto";
+import "google/protobuf/timestamp.proto";
+
+option csharp_namespace = "Google.Cloud.Retail.V2Beta";
+option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2beta;retail";
+option java_multiple_files = true;
+option java_outer_classname = "ModelProto";
+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";
+
+// Metadata that describes the training and serving parameters of a
+// [Model][google.cloud.retail.v2beta.Model]. A
+// [Model][google.cloud.retail.v2beta.Model] can be associated with a
+// [ServingConfig][google.cloud.retail.v2beta.ServingConfig] and then queried
+// through the Predict API.
+message Model {
+  option (google.api.resource) = {
+    type: "retail.googleapis.com/Model"
+    pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/models/{model}"
+  };
+
+  // Represents an ordered combination of valid serving configs, which
+  // can be used for `PAGE_OPTIMIZATION` recommendations.
+  message ServingConfigList {
+    // Optional. A set of valid serving configs that may be used for
+    // `PAGE_OPTIMIZATION`.
+    repeated string serving_config_ids = 1
+        [(google.api.field_behavior) = OPTIONAL];
+  }
+
+  // The serving state of the model.
+  enum ServingState {
+    // Unspecified serving state.
+    SERVING_STATE_UNSPECIFIED = 0;
+
+    // The model is not serving.
+    INACTIVE = 1;
+
+    // The model is serving and can be queried.
+    ACTIVE = 2;
+
+    // The model is trained on tuned hyperparameters and can be
+    // queried.
+    TUNED = 3;
+  }
+
+  // The training state of the model.
+  enum TrainingState {
+    // Unspecified training state.
+    TRAINING_STATE_UNSPECIFIED = 0;
+
+    // The model training is paused.
+    PAUSED = 1;
+
+    // The model is training.
+    TRAINING = 2;
+  }
+
+  // Describes whether periodic tuning is enabled for this model
+  // or not. Periodic tuning is scheduled at most every three months. You can
+  // start a tuning process manually by using the `TuneModel`
+  // method, which starts a tuning process immediately and resets the quarterly
+  // schedule. Enabling or disabling periodic tuning does not affect any
+  // current tuning processes.
+  enum PeriodicTuningState {
+    // Unspecified default value, should never be explicitly set.
+    PERIODIC_TUNING_STATE_UNSPECIFIED = 0;
+
+    // The model has periodic tuning disabled. Tuning
+    // can be reenabled by calling the `EnableModelPeriodicTuning`
+    // method or by calling the `TuneModel` method.
+    PERIODIC_TUNING_DISABLED = 1;
+
+    // The model cannot be tuned with periodic tuning OR the
+    // `TuneModel` method. Hide the options in customer UI and
+    // reject any requests through the backend self serve API.
+    ALL_TUNING_DISABLED = 3;
+
+    // The model has periodic tuning enabled. Tuning
+    // can be disabled by calling the `DisableModelPeriodicTuning`
+    // method.
+    PERIODIC_TUNING_ENABLED = 2;
+  }
+
+  // Describes whether this model have sufficient training data
+  // to be continuously trained.
+  enum DataState {
+    // Unspecified default value, should never be explicitly set.
+    DATA_STATE_UNSPECIFIED = 0;
+
+    // The model has sufficient training data.
+    DATA_OK = 1;
+
+    // The model does not have sufficient training data. Error
+    // messages can be queried via Stackdriver.
+    DATA_ERROR = 2;
+  }
+
+  // Required. The fully qualified resource name of the model.
+  //
+  // Format:
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+  // catalog_id has char limit of 50.
+  // recommendation_model_id has char limit of 40.
+  string name = 1 [(google.api.field_behavior) = REQUIRED];
+
+  // Required. The display name of the model.
+  //
+  // Should be human readable, used to display Recommendation Models in the
+  // Retail Cloud Console Dashboard. UTF-8 encoded string with limit of 1024
+  // characters.
+  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
+
+  // Optional. The training state that the model is in (e.g.
+  // `TRAINING` or `PAUSED`).
+  //
+  // Since part of the cost of running the service
+  // is frequency of training - this can be used to determine when to train
+  // model in order to control cost. If not specified: the default value for
+  // `CreateModel` method is `TRAINING`. The default value for
+  // `UpdateModel` method is to keep the state the same as before.
+  TrainingState training_state = 3 [(google.api.field_behavior) = OPTIONAL];
+
+  // Output only. The serving state of the model: `ACTIVE`, `NOT_ACTIVE`.
+  ServingState serving_state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+  // Output only. Timestamp the Recommendation Model was created at.
+  google.protobuf.Timestamp create_time = 5
+      [(google.api.field_behavior) = OUTPUT_ONLY];
+
+  // Output only. Timestamp the Recommendation Model was last updated. E.g.
+  // if a Recommendation Model was paused - this would be the time the pause was
+  // initiated.
+  google.protobuf.Timestamp update_time = 6
+      [(google.api.field_behavior) = OUTPUT_ONLY];
+
+  // Required. The type of model e.g. `home-page`.
+  //
+  // Currently supported values: `recommended-for-you`, `others-you-may-like`,
+  // `frequently-bought-together`, `page-optimization`, `similar-items`,
+  // `buy-it-again`, and `recently-viewed`(readonly value).
+  //
+  // This field together with
+  // [optimization_objective][google.cloud.retail.v2beta.Model.optimization_objective]
+  // describe model metadata to use to control model training and serving.
+  // See https://cloud.google.com/retail/docs/models
+  // for more details on what the model metadata control and which combination
+  // of parameters are valid. For invalid combinations of parameters (e.g. type
+  // = `frequently-bought-together` and optimization_objective = `ctr`), you
+  // receive an error 400 if you try to create/update a recommendation with
+  // this set of knobs.
+  string type = 7 [(google.api.field_behavior) = REQUIRED];
+
+  // Optional. The optimization objective e.g. `cvr`.
+  //
+  // Currently supported
+  // values: `ctr`, `cvr`, `revenue-per-order`.
+  //
+  //  If not specified, we choose default based on model type.
+  // Default depends on type of recommendation:
+  //
+  // `recommended-for-you` => `ctr`
+  //
+  // `others-you-may-like` => `ctr`
+  //
+  // `frequently-bought-together` => `revenue_per_order`
+  //
+  // This field together with
+  // [optimization_objective][google.cloud.retail.v2beta.Model.type]
+  // describe model metadata to use to control model training and serving.
+  // See https://cloud.google.com/retail/docs/models
+  // for more details on what the model metadata control and which combination
+  // of parameters are valid. For invalid combinations of parameters (e.g. type
+  // = `frequently-bought-together` and optimization_objective = `ctr`), you
+  // receive an error 400 if you try to create/update a recommendation with
+  // this set of knobs.
+  string optimization_objective = 8 [(google.api.field_behavior) = OPTIONAL];
+
+  // Optional. The state of periodic tuning.
+  //
+  // The period we use is 3 months - to do a
+  // one-off tune earlier use the `TuneModel` method. Default value
+  // is `PERIODIC_TUNING_ENABLED`.
+  PeriodicTuningState periodic_tuning_state = 11
+      [(google.api.field_behavior) = OPTIONAL];
+
+  // Output only. The timestamp when the latest successful tune finished.
+  google.protobuf.Timestamp last_tune_time = 12
+      [(google.api.field_behavior) = OUTPUT_ONLY];
+
+  // Output only. The tune operation associated with the model.
+  //
+  // Can be used to determine if there is an ongoing tune for this
+  // recommendation. Empty field implies no tune is goig on.
+  string tuning_operation = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+  // Output only. The state of data requirements for this model: `DATA_OK` and
+  // `DATA_ERROR`.
+  //
+  // Recommendation model cannot be trained if the data is in
+  // `DATA_ERROR` state. Recommendation model can have `DATA_ERROR` state even
+  // if serving state is `ACTIVE`: models were trained successfully before, but
+  // cannot be refreshed because model no longer has sufficient
+  // data for training.
+  DataState data_state = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+  // Optional. If `RECOMMENDATIONS_FILTERING_ENABLED`, recommendation filtering
+  // by attributes is enabled for the model.
+  RecommendationsFilteringOption filtering_option = 18
+      [(google.api.field_behavior) = OPTIONAL];
+
+  // Output only. The list of valid serving configs associated with the
+  // PageOptimizationConfig.
+  repeated ServingConfigList serving_config_lists = 19
+      [(google.api.field_behavior) = OUTPUT_ONLY];
+}
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/model_service.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/model_service.proto
new file mode 100644
index 000000000000..3a9a3c5a360c
--- /dev/null
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/model_service.proto
@@ -0,0 +1,244 @@
+// Copyright 2022 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/model.proto";
+import "google/longrunning/operations.proto";
+import "google/protobuf/empty.proto";
+import "google/protobuf/field_mask.proto";
+
+option csharp_namespace = "Google.Cloud.Retail.V2Beta";
+option go_package = "google.golang.org/genproto/googleapis/cloud/retail/v2beta;retail";
+option java_multiple_files = true;
+option java_outer_classname = "ModelServiceProto";
+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 performing CRUD operations on models.
+// Recommendation models contain all the metadata necessary to generate a set of
+// models for the `Predict()` API. A model is queried
+// indirectly via a ServingConfig, which associates a model with a
+// given Placement (e.g. Frequently Bought Together on Home Page).
+//
+// This service allows you to do the following:
+//
+// * Initiate training of a model.
+// * Pause training of an existing model.
+// * List all the available models along with their metadata.
+// * Control their tuning schedule.
+service ModelService {
+  option (google.api.default_host) = "retail.googleapis.com";
+  option (google.api.oauth_scopes) =
+      "https://www.googleapis.com/auth/cloud-platform";
+
+  // Creates a new model.
+  rpc CreateModel(CreateModelRequest) returns (google.longrunning.Operation) {
+    option (google.api.http) = {
+      post: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/models"
+      body: "model"
+    };
+    option (google.api.method_signature) = "parent,model";
+    option (google.longrunning.operation_info) = {
+      response_type: "google.cloud.retail.v2beta.Model"
+      metadata_type: "google.cloud.retail.v2beta.CreateModelMetadata"
+    };
+  }
+
+  // Pauses the training of an existing model.
+  rpc PauseModel(PauseModelRequest) returns (Model) {
+    option (google.api.http) = {
+      post: "/v2beta/{name=projects/*/locations/*/catalogs/*/models/*}:pause"
+      body: "*"
+    };
+    option (google.api.method_signature) = "name";
+  }
+
+  // Resumes the training of an existing model.
+  rpc ResumeModel(ResumeModelRequest) returns (Model) {
+    option (google.api.http) = {
+      post: "/v2beta/{name=projects/*/locations/*/catalogs/*/models/*}:resume"
+      body: "*"
+    };
+    option (google.api.method_signature) = "name";
+  }
+
+  // Deletes an existing model.
+  rpc DeleteModel(DeleteModelRequest) returns (google.protobuf.Empty) {
+    option (google.api.http) = {
+      delete: "/v2beta/{name=projects/*/locations/*/catalogs/*/models/*}"
+    };
+    option (google.api.method_signature) = "name";
+  }
+
+  // Lists all the models linked to this event store.
+  rpc ListModels(ListModelsRequest) returns (ListModelsResponse) {
+    option (google.api.http) = {
+      get: "/v2beta/{parent=projects/*/locations/*/catalogs/*}/models"
+    };
+    option (google.api.method_signature) = "parent";
+  }
+
+  // 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.
+  rpc UpdateModel(UpdateModelRequest) returns (Model) {
+    option (google.api.http) = {
+      patch: "/v2beta/{model.name=projects/*/locations/*/catalogs/*/models/*}"
+      body: "model"
+    };
+    option (google.api.method_signature) = "model,update_mask";
+  }
+
+  // Tunes an existing model.
+  rpc TuneModel(TuneModelRequest) returns (google.longrunning.Operation) {
+    option (google.api.http) = {
+      post: "/v2beta/{name=projects/*/locations/*/catalogs/*/models/*}:tune"
+      body: "*"
+    };
+    option (google.api.method_signature) = "name";
+    option (google.longrunning.operation_info) = {
+      response_type: "google.cloud.retail.v2beta.TuneModelResponse"
+      metadata_type: "google.cloud.retail.v2beta.TuneModelMetadata"
+    };
+  }
+}
+
+// Request for creating a model.
+message CreateModelRequest {
+  // Required. The parent resource under which to create the model. Format:
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+  string parent = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
+  ];
+
+  // Required. The payload of the [Model][google.cloud.retail.v2beta.Model]  to
+  // create.
+  Model model = 2 [(google.api.field_behavior) = REQUIRED];
+
+  // Optional. Whether to run a dry run to validate the request (without
+  // actually creating the model).
+  bool dry_run = 3 [(google.api.field_behavior) = OPTIONAL];
+}
+
+// Request for updating an existing model.
+message UpdateModelRequest {
+  // Required. The body of the updated
+  // [Model][google.cloud.retail.v2beta.Model].
+  Model model = 1 [(google.api.field_behavior) = REQUIRED];
+
+  // Optional. Indicates which fields in the provided 'model' to
+  // update. If not set, by default updates all fields.
+  google.protobuf.FieldMask update_mask = 2
+      [(google.api.field_behavior) = OPTIONAL];
+}
+
+// Request for pausing training of a model.
+message PauseModelRequest {
+  // Required. The name of the model to pause.
+  // Format:
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+  string name = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Model" }
+  ];
+}
+
+// Request for resuming training of a model.
+message ResumeModelRequest {
+  // Required. The name of the model to resume.
+  // Format:
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+  string name = 1 [(google.api.field_behavior) = REQUIRED];
+}
+
+// Request for listing models associated with a resource.
+message ListModelsRequest {
+  // Required. The parent for which to list models.
+  // Format:
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
+  string parent = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
+  ];
+
+  // Optional. Maximum number of results to return. If unspecified, defaults
+  // to 50. Max allowed value is 1000.
+  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
+
+  // Optional. A page token, received from a previous `ListModels`
+  // call. Provide this to retrieve the subsequent page.
+  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
+}
+
+// Request for deleting a model.
+message DeleteModelRequest {
+  // Required. The resource name of the
+  // [Model][google.cloud.retail.v2beta.Model] to delete. Format:
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+  string name = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Model" }
+  ];
+}
+
+// Response to a ListModelRequest.
+message ListModelsResponse {
+  // List of Models.
+  repeated Model models = 1;
+
+  // Pagination token, if not returned indicates the last page.
+  string next_page_token = 2;
+}
+
+// Request to manually start a tuning process now (instead of waiting for
+// the periodically scheduled tuning to happen).
+message TuneModelRequest {
+  // Required. The resource name of the model to tune.
+  // Format:
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+  string name = 1 [
+    (google.api.field_behavior) = REQUIRED,
+    (google.api.resource_reference) = { type: "retail.googleapis.com/Model" }
+  ];
+}
+
+// Metadata associated with a create operation.
+message CreateModelMetadata {
+  // The resource name of the model that this create applies to.
+  // Format:
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+  string model = 1;
+}
+
+// Metadata associated with a tune operation.
+message TuneModelMetadata {
+  // The resource name of the model that this tune applies to.
+  // Format:
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/models/{model_id}`
+  string model = 1;
+}
+
+// Response associated with a tune operation.
+message TuneModelResponse {}
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/prediction_service.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/prediction_service.proto
index d4d18ee10201..1ac3026d63fa 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/prediction_service.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/prediction_service.proto
@@ -19,6 +19,7 @@ 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/user_event.proto";
 import "google/protobuf/struct.proto";
 
@@ -84,14 +85,14 @@ message PredictRequest {
   // [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id] unset.
   UserEvent user_event = 2 [(google.api.field_behavior) = REQUIRED];
 
-  // Maximum number of results to return per page. Set this property
-  // to the number of prediction results needed. If zero, the service will
-  // choose a reasonable default. The maximum allowed value is 100. Values
-  // above 100 will be coerced to 100.
+  // Maximum number of results to return. Set this property to the number of
+  // prediction results needed. If zero, the service will choose a reasonable
+  // default. The maximum allowed value is 100. Values above 100 will be coerced
+  // to 100.
   int32 page_size = 3;
 
-  // This field is not used for now; leave it unset.
-  string page_token = 4;
+  // This field is not used; leave it unset.
+  string page_token = 4 [deprecated = true];
 
   // Filter for restricting prediction results with a length limit of 5,000
   // characters. Accepts values for tags and the `filterOutOfStockItems` flag.
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product.proto
index 9490e09fcb80..8b10090136fc 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product.proto
@@ -199,7 +199,7 @@ message Product {
   // The [type][google.cloud.retail.v2beta.Product.type] of the members must be
   // either [Type.PRIMARY][google.cloud.retail.v2beta.Product.Type.PRIMARY] or
   // [Type.VARIANT][google.cloud.retail.v2beta.Product.Type.VARIANT] otherwise
-  // and INVALID_ARGUMENT error is thrown. Should not set it for other types. A
+  // an INVALID_ARGUMENT error is thrown. Should not set it for other types. A
   // maximum of 1000 values are allowed. Otherwise, an INVALID_ARGUMENT error is
   // return.
   repeated string collection_member_ids = 5;
@@ -230,7 +230,7 @@ message Product {
   //
   //
   // To represent full path of category, use '>' sign to separate different
-  // hierarchies. If '>' is part of the category name, please replace it with
+  // hierarchies. If '>' is part of the category name, replace it with
   // other character(s).
   //
   // For example, if a shoes product belongs to both
@@ -563,4 +563,15 @@ message Product {
   // [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct].
   // Do not set this field in API requests.
   repeated Product variants = 31 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+  // Output only. A list of local inventories specific to different places.
+  //
+  // This is only available for users who have Retail Search enabled, and it can
+  // be managed by
+  // [ProductService.AddLocalInventories][google.cloud.retail.v2beta.ProductService.AddLocalInventories]
+  // and
+  // [ProductService.RemoveLocalInventories][google.cloud.retail.v2beta.ProductService.RemoveLocalInventories]
+  // APIs.
+  repeated LocalInventory local_inventories = 35
+      [(google.api.field_behavior) = OUTPUT_ONLY];
 }
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product_service.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product_service.proto
index a9bfd96581c0..0c09943324d0 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product_service.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/product_service.proto
@@ -111,9 +111,9 @@ service ProductService {
   //
   // 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, updates are not immediately manifested in the
+  // 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
@@ -123,10 +123,10 @@ service ProductService {
   // [ProductService.CreateProduct][google.cloud.retail.v2beta.ProductService.CreateProduct]
   // and
   // [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct],
-  // the specified inventory field value(s) will overwrite any existing value(s)
+  // the specified inventory field value(s) overwrite any existing value(s)
   // while ignoring the last update time for this field. Furthermore, the last
-  // update time for the specified inventory fields will be overwritten to the
-  // time of the
+  // 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]
@@ -134,11 +134,11 @@ service ProductService {
   //
   // If no inventory fields are set in
   // [CreateProductRequest.product][google.cloud.retail.v2beta.CreateProductRequest.product],
-  // then any pre-existing inventory information for this product will be used.
+  // then any pre-existing inventory information for this product is used.
   //
   // If no inventory fields are set in
   // [SetInventoryRequest.set_mask][google.cloud.retail.v2beta.SetInventoryRequest.set_mask],
-  // then any existing inventory information will be preserved.
+  // then any existing inventory information is preserved.
   //
   // Pre-existing inventory information can only be updated with
   // [ProductService.SetInventory][google.cloud.retail.v2beta.ProductService.SetInventory],
@@ -146,8 +146,17 @@ service ProductService {
   // and
   // [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2beta.ProductService.RemoveFulfillmentPlaces].
   //
+  // The returned [Operation][google.longrunning.Operation]s is obsolete after
+  // one day, and the [GetOperation][google.longrunning.Operations.GetOperation]
+  // API returns `NOT_FOUND` afterwards.
+  //
+  // If conflicting updates are issued, the
+  // [Operation][google.longrunning.Operation]s associated with the stale
+  // updates are not marked as [done][google.longrunning.Operation.done] until
+  // they are obsolete.
+  //
   // This feature is only available for users who have Retail Search enabled.
-  // Please enable Retail Search on Cloud Console before using this feature.
+  // Enable Retail Search on Cloud Console before using this feature.
   rpc SetInventory(SetInventoryRequest) returns (google.longrunning.Operation) {
     option (google.api.http) = {
       post: "/v2beta/{inventory.name=projects/*/locations/*/catalogs/*/branches/*/products/**}:setInventory"
@@ -173,8 +182,17 @@ service ProductService {
   // or
   // [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
   //
+  // The returned [Operation][google.longrunning.Operation]s will be obsolete
+  // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation]
+  // API will return NOT_FOUND afterwards.
+  //
+  // If conflicting updates are issued, the
+  // [Operation][google.longrunning.Operation]s associated with the stale
+  // updates will not be marked as [done][google.longrunning.Operation.done]
+  // until being obsolete.
+  //
   // This feature is only available for users who have Retail Search enabled.
-  // Please enable Retail Search on Cloud Console before using this feature.
+  // Enable Retail Search on Cloud Console before using this feature.
   rpc AddFulfillmentPlaces(AddFulfillmentPlacesRequest)
       returns (google.longrunning.Operation) {
     option (google.api.http) = {
@@ -201,8 +219,17 @@ service ProductService {
   // or
   // [ProductService.ListProducts][google.cloud.retail.v2beta.ProductService.ListProducts].
   //
+  // The returned [Operation][google.longrunning.Operation]s will be obsolete
+  // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation]
+  // API will return NOT_FOUND afterwards.
+  //
+  // If conflicting updates are issued, the
+  // [Operation][google.longrunning.Operation]s associated with the stale
+  // updates will not be marked as [done][google.longrunning.Operation.done]
+  // until being obsolete.
+  //
   // This feature is only available for users who have Retail Search enabled.
-  // Please enable Retail Search on Cloud Console before using this feature.
+  // Enable Retail Search on Cloud Console before using this feature.
   rpc RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest)
       returns (google.longrunning.Operation) {
     option (google.api.http) = {
@@ -236,8 +263,17 @@ service ProductService {
   // [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct]
   // has no effect on local inventories.
   //
+  // The returned [Operation][google.longrunning.Operation]s will be obsolete
+  // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation]
+  // API will return NOT_FOUND afterwards.
+  //
+  // If conflicting updates are issued, the
+  // [Operation][google.longrunning.Operation]s associated with the stale
+  // updates will not be marked as [done][google.longrunning.Operation.done]
+  // until being obsolete.
+  //
   // This feature is only available for users who have Retail Search enabled.
-  // Please enable Retail Search on Cloud Console before using this feature.
+  // Enable Retail Search on Cloud Console before using this feature.
   rpc AddLocalInventories(AddLocalInventoriesRequest)
       returns (google.longrunning.Operation) {
     option (google.api.http) = {
@@ -269,8 +305,17 @@ service ProductService {
   // [ProductService.UpdateProduct][google.cloud.retail.v2beta.ProductService.UpdateProduct]
   // has no effect on local inventories.
   //
+  // The returned [Operation][google.longrunning.Operation]s will be obsolete
+  // after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation]
+  // API will return NOT_FOUND afterwards.
+  //
+  // If conflicting updates are issued, the
+  // [Operation][google.longrunning.Operation]s associated with the stale
+  // updates will not be marked as [done][google.longrunning.Operation.done]
+  // until being obsolete.
+  //
   // This feature is only available for users who have Retail Search enabled.
-  // Please enable Retail Search on Cloud Console before using this feature.
+  // Enable Retail Search on Cloud Console before using this feature.
   rpc RemoveLocalInventories(RemoveLocalInventoriesRequest)
       returns (google.longrunning.Operation) {
     option (google.api.http) = {
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/search_service.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/search_service.proto
index bf0764fd9708..5a1004410e64 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/search_service.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/search_service.proto
@@ -37,7 +37,7 @@ option ruby_package = "Google::Cloud::Retail::V2beta";
 // Service for search.
 //
 // This feature is only available for users who have Retail Search enabled.
-// Please enable Retail Search on Cloud Console before using this feature.
+// Enable Retail Search on Cloud Console before using this feature.
 service SearchService {
   option (google.api.default_host) = "retail.googleapis.com";
   option (google.api.oauth_scopes) =
@@ -46,7 +46,7 @@ service SearchService {
   // Performs a search.
   //
   // This feature is only available for users who have Retail Search enabled.
-  // Please enable Retail Search on Cloud Console before using this feature.
+  // Enable Retail Search on Cloud Console before using this feature.
   rpc Search(SearchRequest) returns (SearchResponse) {
     option (google.api.http) = {
       post: "/v2beta/{placement=projects/*/locations/*/catalogs/*/placements/*}:search"
@@ -364,7 +364,8 @@ message SearchRequest {
   message QueryExpansionSpec {
     // Enum describing under which condition query expansion should occur.
     enum Condition {
-      // Unspecified query expansion condition. This defaults to
+      // Unspecified query expansion condition. In this case, server behavior
+      // defaults to
       // [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
       CONDITION_UNSPECIFIED = 0;
 
@@ -395,7 +396,8 @@ message SearchRequest {
       // [Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
       MODE_UNSPECIFIED = 0;
 
-      // Let CRS decide whether to use personalization.
+      // Let CRS decide whether to use personalization based on quality of user
+      // event data.
       AUTO = 1;
 
       // Disable personalization.
@@ -436,15 +438,21 @@ message SearchRequest {
   // The search mode of each search request.
   enum SearchMode {
     // Default value. In this case both product search and faceted search will
-    // be performed. Both [SearchResponse.SearchResult] and
-    // [SearchResponse.Facet] will be returned.
+    // be performed. Both
+    // [SearchResponse.SearchResult][google.cloud.retail.v2beta.SearchResponse.SearchResult]
+    // and
+    // [SearchResponse.Facet][google.cloud.retail.v2beta.SearchResponse.Facet]
+    // will be returned.
     SEARCH_MODE_UNSPECIFIED = 0;
 
     // Only product search will be performed. The faceted search will be
     // disabled.
     //
-    // Only [SearchResponse.SearchResult] will be returned.
-    // [SearchResponse.Facet] will not be returned, even if
+    // Only
+    // [SearchResponse.SearchResult][google.cloud.retail.v2beta.SearchResponse.SearchResult]
+    // will be returned.
+    // [SearchResponse.Facet][google.cloud.retail.v2beta.SearchResponse.Facet]
+    // will not be returned, even if
     // [SearchRequest.facet_specs][google.cloud.retail.v2beta.SearchRequest.facet_specs]
     // or
     // [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec]
@@ -459,7 +467,9 @@ message SearchRequest {
     // and
     // [SearchRequest.dynamic_facet_spec][google.cloud.retail.v2beta.SearchRequest.dynamic_facet_spec]
     // should be set. Otherwise, an INVALID_ARGUMENT error is returned. Only
-    // [SearchResponse.Facet] will be returned. [SearchResponse.SearchResult]
+    // [SearchResponse.Facet][google.cloud.retail.v2beta.SearchResponse.Facet]
+    // will be returned.
+    // [SearchResponse.SearchResult][google.cloud.retail.v2beta.SearchResponse.SearchResult]
     // will not be returned.
     FACETED_SEARCH_ONLY = 2;
   }
@@ -671,7 +681,7 @@ message SearchRequest {
   // [UserEvent.page_categories][google.cloud.retail.v2beta.UserEvent.page_categories];
   //
   // To represent full path of category, use '>' sign to separate different
-  // hierarchies. If '>' is part of the category name, please replace it with
+  // hierarchies. If '>' is part of the category name, replace it with
   // other character(s).
   //
   // Category pages include special pages such as sales or promotions. For
@@ -684,6 +694,15 @@ message SearchRequest {
   SearchMode search_mode = 31;
 
   // The specification for personalization.
+  //
+  // Notice that if both
+  // [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+  // and
+  // [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+  // are set.
+  // [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+  // will override
+  // [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
   PersonalizationSpec personalization_spec = 32;
 
   // The labels applied to a resource must meet the following requirements:
@@ -787,6 +806,21 @@ message SearchResponse {
     // `{key: "pickupInStore.store1" value { number_value: 10 }}` means a there
     // are 10 variants in this product are available in the store "store1".
     map variant_rollup_values = 5;
+
+    // Specifies previous events related to this product for this user based on
+    // [UserEvent][google.cloud.retail.v2beta.UserEvent] with same
+    // [SearchRequest.visitor_id][google.cloud.retail.v2beta.SearchRequest.visitor_id]
+    // or [UserInfo.user_id][google.cloud.retail.v2beta.UserInfo.user_id].
+    //
+    // This is set only when
+    // [SearchRequest.PersonalizationSpec.mode][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.mode]
+    // is
+    // [SearchRequest.PersonalizationSpec.Mode.AUTO][google.cloud.retail.v2beta.SearchRequest.PersonalizationSpec.Mode.AUTO].
+    //
+    // Possible values:
+    //
+    // * `purchased`: Indicates that this product has been purchased before.
+    repeated string personal_labels = 7;
   }
 
   // A facet result.
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config.proto
index 431a4a411497..35d1cf853533 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config.proto
@@ -32,14 +32,25 @@ option ruby_package = "Google::Cloud::Retail::V2beta";
 
 // Configures metadata that is used to generate serving time results (e.g.
 // search results or recommendation predictions).
-// The ServingConfig is passed in the search and predict request and together
-// with the Catalog.default_branch, generates results.
 message ServingConfig {
   option (google.api.resource) = {
     type: "retail.googleapis.com/ServingConfig"
     pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/servingConfigs/{serving_config}"
   };
 
+  // What type of diversity - data or rule based.
+  // If none is specified, default to rule based.
+  enum DiversityType {
+    // Default value.
+    DIVERSITY_TYPE_UNSPECIFIED = 0;
+
+    // Rule based diversity.
+    RULE_BASED_DIVERSITY = 2;
+
+    // Data driven diversity.
+    DATA_DRIVEN_DIVERSITY = 3;
+  }
+
   // Immutable. Fully qualified name
   // `projects/*/locations/global/catalogs/*/servingConfig/*`
   string name = 1 [(google.api.field_behavior) = IMMUTABLE];
@@ -51,7 +62,8 @@ message ServingConfig {
   // characters. Otherwise, an INVALID_ARGUMENT error is returned.
   string display_name = 2 [(google.api.field_behavior) = REQUIRED];
 
-  // The id of the model to use at serving time.
+  // The id of the model in the same
+  // [Catalog][google.cloud.retail.v2beta.Catalog] to use at serving time.
   // Currently only RecommendationModels are supported:
   // https://cloud.google.com/retail/recommendations-ai/docs/create-models
   // Can be changed but only to a compatible model (e.g.
@@ -70,13 +82,13 @@ message ServingConfig {
   // click-through and conversion rates.
   //  Allowed values are:
   //
-  // * 'no-price-reranking'
-  // * 'low-price-raranking'
-  // * 'medium-price-reranking'
-  // * 'high-price-reranking'
+  // * `no-price-reranking`
+  // * `low-price-raranking`
+  // * `medium-price-reranking`
+  // * `high-price-reranking`
   //
   // If not specified, we choose default based on model type. Default value:
-  // 'no-price-reranking'.
+  // `no-price-reranking`.
   //
   // Can only be set if
   // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
@@ -205,16 +217,16 @@ message ServingConfig {
   repeated string ignore_control_ids = 15;
 
   // How much diversity to use in recommendation model results e.g.
-  // 'medium-diversity' or 'high-diversity'. Currently supported values:
+  // `medium-diversity` or `high-diversity`. Currently supported values:
   //
-  // * 'no-diversity'
-  // * 'low-diversity'
-  // * 'medium-diversity'
-  // * 'high-diversity'
-  // * 'auto-diversity'
+  // * `no-diversity`
+  // * `low-diversity`
+  // * `medium-diversity`
+  // * `high-diversity`
+  // * `auto-diversity`
   //
   // If not specified, we choose default based on recommendation model
-  // type. Default value: 'no-diversity'.
+  // type. Default value: `no-diversity`.
   //
   // Can only be set if
   // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
@@ -222,13 +234,16 @@ message ServingConfig {
   // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
   string diversity_level = 8;
 
-  // Whether to add additional category filters on the 'similar-items' model.
+  // What kind of diversity to use - data driven or rule based.
+  DiversityType diversity_type = 20;
+
+  // Whether to add additional category filters on the `similar-items` model.
   // If not specified, we enable it by default.
   //  Allowed values are:
   //
-  // * 'no-category-match': No additional filtering of original results from
+  // * `no-category-match`: No additional filtering of original results from
   //   the model and the customer's filters.
-  // * 'relaxed-category-match': Only keep results with categories that match
+  // * `relaxed-category-match`: Only keep results with categories that match
   //   at least one item categories in the PredictRequests's context item.
   //   * If customer also sends filters in the PredictRequest, then the results
   //   will satisfy both conditions (user given and category match).
@@ -239,6 +254,23 @@ message ServingConfig {
   // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
   string enable_category_filter_level = 16;
 
+  // The specification for personalization spec.
+  //
+  // Can only be set if
+  // [solution_types][google.cloud.retail.v2beta.ServingConfig.solution_types]
+  // is
+  // [SOLUTION_TYPE_SEARCH][google.cloud.retail.v2main.SolutionType.SOLUTION_TYPE_SEARCH].
+  //
+  // Notice that if both
+  // [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec]
+  // and
+  // [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+  // are set.
+  // [SearchRequest.personalization_spec][google.cloud.retail.v2beta.SearchRequest.personalization_spec]
+  // will override
+  // [ServingConfig.personalization_spec][google.cloud.retail.v2beta.ServingConfig.personalization_spec].
+  SearchRequest.PersonalizationSpec personalization_spec = 21;
+
   // Required. Immutable. Specifies the solution types that a serving config can
   // be associated with. Currently we support setting only one type of solution.
   repeated SolutionType solution_types = 19 [
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config_service.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config_service.proto
index e2d5319a4631..46bdcd9b04f7 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config_service.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/serving_config_service.proto
@@ -158,7 +158,7 @@ message UpdateServingConfigRequest {
 // Request for DeleteServingConfig method.
 message DeleteServingConfigRequest {
   // Required. The resource name of the ServingConfig to delete. Format:
-  // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
   string name = 1 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.resource_reference) = {
@@ -170,7 +170,7 @@ message DeleteServingConfigRequest {
 // Request for GetServingConfig method.
 message GetServingConfigRequest {
   // Required. The resource name of the ServingConfig to get. Format:
-  // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
   string name = 1 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.resource_reference) = {
@@ -182,7 +182,7 @@ message GetServingConfigRequest {
 // Request for ListServingConfigs method.
 message ListServingConfigsRequest {
   // Required. The catalog resource name. Format:
-  // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}`
   string parent = 1 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.resource_reference) = { type: "retail.googleapis.com/Catalog" }
@@ -210,7 +210,7 @@ message ListServingConfigsResponse {
 // Request for AddControl method.
 message AddControlRequest {
   // Required. The source ServingConfig resource name . Format:
-  // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
   string serving_config = 1 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.resource_reference) = {
@@ -226,7 +226,7 @@ message AddControlRequest {
 // Request for RemoveControl method.
 message RemoveControlRequest {
   // Required. The source ServingConfig resource name . Format:
-  // projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}
+  // `projects/{project_number}/locations/{location_id}/catalogs/{catalog_id}/servingConfigs/{serving_config_id}`
   string serving_config = 1 [
     (google.api.field_behavior) = REQUIRED,
     (google.api.resource_reference) = {
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event.proto
index 06c8e64c2315..3d88483e79fe 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event.proto
@@ -227,7 +227,7 @@ message UserEvent {
   // The categories associated with a category page.
   //
   // To represent full path of category, use '>' sign to separate different
-  // hierarchies. If '>' is part of the category name, please replace it with
+  // hierarchies. If '>' is part of the category name, replace it with
   // other character(s).
   //
   // Category pages include special pages such as sales or promotions. For
diff --git a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event_service.proto b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event_service.proto
index c647a45bb24a..74dccdff892f 100644
--- a/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event_service.proto
+++ b/java-retail/proto-google-cloud-retail-v2beta/src/main/proto/google/cloud/retail/v2beta/user_event_service.proto
@@ -20,6 +20,7 @@ import "google/api/annotations.proto";
 import "google/api/client.proto";
 import "google/api/field_behavior.proto";
 import "google/api/httpbody.proto";
+import "google/api/resource.proto";
 import "google/cloud/retail/v2beta/import_config.proto";
 import "google/cloud/retail/v2beta/purge_config.proto";
 import "google/cloud/retail/v2beta/user_event.proto";
@@ -79,9 +80,9 @@ service UserEventService {
   // 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
+  // `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.
+  // `Operation.metadata` is of type `ImportMetadata`.
   rpc ImportUserEvents(ImportUserEventsRequest)
       returns (google.longrunning.Operation) {
     option (google.api.http) = {
@@ -94,14 +95,14 @@ service UserEventService {
     };
   }
 
-  // Starts a user event rejoin operation with latest product catalog. Events
-  // will not be annotated with detailed product information if product is
-  // missing from the catalog at the time the user event is ingested, and these
-  // events are stored as unjoined events with a limited usage on training and
-  // serving. This method can be used to start a join operation on specified
-  // events with latest version of product catalog. It can also be used to
-  // correct events joined with the wrong product catalog. A rejoin operation
-  // can take hours or days to complete.
+  // 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.
   rpc RejoinUserEvents(RejoinUserEventsRequest)
       returns (google.longrunning.Operation) {
     option (google.api.http) = {
@@ -151,11 +152,11 @@ message CollectUserEventRequest {
 message RejoinUserEventsRequest {
   // The scope of user events to be rejoined with the latest product catalog.
   // If the rejoining aims at reducing number of unjoined events, set
-  // UserEventRejoinScope to UNJOINED_EVENTS.
+  // `UserEventRejoinScope` to `UNJOINED_EVENTS`.
   // If the rejoining aims at correcting product catalog information in joined
-  // events, set UserEventRejoinScope to JOINED_EVENTS.
-  // If all events needs to be rejoined, set UserEventRejoinScope to
-  // USER_EVENT_REJOIN_SCOPE_UNSPECIFIED.
+  // events, set `UserEventRejoinScope` to `JOINED_EVENTS`.
+  // If all events needs to be rejoined, set `UserEventRejoinScope` to
+  // `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED`.
   enum UserEventRejoinScope {
     // Rejoin all events with the latest product catalog, including both joined
     // events and unjoined events.
@@ -174,16 +175,16 @@ message RejoinUserEventsRequest {
 
   // The type of the user event rejoin to define the scope and range of the user
   // events to be rejoined with the latest product catalog. Defaults to
-  // USER_EVENT_REJOIN_SCOPE_UNSPECIFIED if this field is not set, or set to an
-  // invalid integer value.
+  // `USER_EVENT_REJOIN_SCOPE_UNSPECIFIED` if this field is not set, or set to
+  // an invalid integer value.
   UserEventRejoinScope user_event_rejoin_scope = 2;
 }
 
-// Response message for RejoinUserEvents method.
+// Response message for `RejoinUserEvents` method.
 message RejoinUserEventsResponse {
   // Number of user events that were joined with latest product catalog.
   int64 rejoined_user_events_count = 1;
 }
 
-// Metadata for RejoinUserEvents method.
+// Metadata for `RejoinUserEvents` method.
 message RejoinUserEventsMetadata {}
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/catalogserviceclient/batchremovecatalogattributes/AsyncBatchRemoveCatalogAttributes.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/catalogserviceclient/batchremovecatalogattributes/AsyncBatchRemoveCatalogAttributes.java
new file mode 100644
index 000000000000..15a26c902222
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/catalogserviceclient/batchremovecatalogattributes/AsyncBatchRemoveCatalogAttributes.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2022 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_catalogserviceclient_batchremovecatalogattributes_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.retail.v2beta.AttributesConfigName;
+import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest;
+import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse;
+import com.google.cloud.retail.v2beta.CatalogServiceClient;
+import java.util.ArrayList;
+
+public class AsyncBatchRemoveCatalogAttributes {
+
+  public static void main(String[] args) throws Exception {
+    asyncBatchRemoveCatalogAttributes();
+  }
+
+  public static void asyncBatchRemoveCatalogAttributes() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+      BatchRemoveCatalogAttributesRequest request =
+          BatchRemoveCatalogAttributesRequest.newBuilder()
+              .setAttributesConfig(
+                  AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+              .addAllAttributeKeys(new ArrayList())
+              .build();
+      ApiFuture future =
+          catalogServiceClient.batchRemoveCatalogAttributesCallable().futureCall(request);
+      // Do something.
+      BatchRemoveCatalogAttributesResponse response = future.get();
+    }
+  }
+}
+// [END retail_v2beta_generated_catalogserviceclient_batchremovecatalogattributes_async]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/catalogserviceclient/batchremovecatalogattributes/SyncBatchRemoveCatalogAttributes.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/catalogserviceclient/batchremovecatalogattributes/SyncBatchRemoveCatalogAttributes.java
new file mode 100644
index 000000000000..f21cbfc2f58d
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/catalogserviceclient/batchremovecatalogattributes/SyncBatchRemoveCatalogAttributes.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2022 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_catalogserviceclient_batchremovecatalogattributes_sync]
+import com.google.cloud.retail.v2beta.AttributesConfigName;
+import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesRequest;
+import com.google.cloud.retail.v2beta.BatchRemoveCatalogAttributesResponse;
+import com.google.cloud.retail.v2beta.CatalogServiceClient;
+import java.util.ArrayList;
+
+public class SyncBatchRemoveCatalogAttributes {
+
+  public static void main(String[] args) throws Exception {
+    syncBatchRemoveCatalogAttributes();
+  }
+
+  public static void syncBatchRemoveCatalogAttributes() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (CatalogServiceClient catalogServiceClient = CatalogServiceClient.create()) {
+      BatchRemoveCatalogAttributesRequest request =
+          BatchRemoveCatalogAttributesRequest.newBuilder()
+              .setAttributesConfig(
+                  AttributesConfigName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+              .addAllAttributeKeys(new ArrayList())
+              .build();
+      BatchRemoveCatalogAttributesResponse response =
+          catalogServiceClient.batchRemoveCatalogAttributes(request);
+    }
+  }
+}
+// [END retail_v2beta_generated_catalogserviceclient_batchremovecatalogattributes_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetCredentialsProvider.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetCredentialsProvider.java
new file mode 100644
index 000000000000..e777dc64b1f5
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetCredentialsProvider.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2022 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_modelserviceclient_create_setcredentialsprovider_sync]
+import com.google.api.gax.core.FixedCredentialsProvider;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.ModelServiceSettings;
+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 for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    ModelServiceSettings modelServiceSettings =
+        ModelServiceSettings.newBuilder()
+            .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+            .build();
+    ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings);
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_create_setcredentialsprovider_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetCredentialsProvider1.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetCredentialsProvider1.java
new file mode 100644
index 000000000000..9a08960ecc82
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetCredentialsProvider1.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2022 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_modelserviceclient_create_setcredentialsprovider1_sync]
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.ModelServiceSettings;
+
+public class SyncCreateSetCredentialsProvider1 {
+
+  public static void main(String[] args) throws Exception {
+    syncCreateSetCredentialsProvider1();
+  }
+
+  public static void syncCreateSetCredentialsProvider1() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    ModelServiceSettings modelServiceSettings =
+        ModelServiceSettings.newBuilder()
+            .setTransportChannelProvider(
+                ModelServiceSettings.defaultHttpJsonTransportProviderBuilder().build())
+            .build();
+    ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings);
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_create_setcredentialsprovider1_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetEndpoint.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetEndpoint.java
new file mode 100644
index 000000000000..43f6f251c829
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/create/SyncCreateSetEndpoint.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2022 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_modelserviceclient_create_setendpoint_sync]
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.ModelServiceSettings;
+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 for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    ModelServiceSettings modelServiceSettings =
+        ModelServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+    ModelServiceClient modelServiceClient = ModelServiceClient.create(modelServiceSettings);
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_create_setendpoint_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/AsyncCreateModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/AsyncCreateModel.java
new file mode 100644
index 000000000000..160941214182
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/AsyncCreateModel.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2022 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_modelserviceclient_createmodel_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.retail.v2beta.CatalogName;
+import com.google.cloud.retail.v2beta.CreateModelRequest;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.longrunning.Operation;
+
+public class AsyncCreateModel {
+
+  public static void main(String[] args) throws Exception {
+    asyncCreateModel();
+  }
+
+  public static void asyncCreateModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      CreateModelRequest request =
+          CreateModelRequest.newBuilder()
+              .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+              .setModel(Model.newBuilder().build())
+              .setDryRun(true)
+              .build();
+      ApiFuture future = modelServiceClient.createModelCallable().futureCall(request);
+      // Do something.
+      Operation response = future.get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_createmodel_async]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/AsyncCreateModelLRO.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/AsyncCreateModelLRO.java
new file mode 100644
index 000000000000..693168312bf8
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/AsyncCreateModelLRO.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2022 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_modelserviceclient_createmodel_lro_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.retail.v2beta.CatalogName;
+import com.google.cloud.retail.v2beta.CreateModelMetadata;
+import com.google.cloud.retail.v2beta.CreateModelRequest;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+
+public class AsyncCreateModelLRO {
+
+  public static void main(String[] args) throws Exception {
+    asyncCreateModelLRO();
+  }
+
+  public static void asyncCreateModelLRO() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      CreateModelRequest request =
+          CreateModelRequest.newBuilder()
+              .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+              .setModel(Model.newBuilder().build())
+              .setDryRun(true)
+              .build();
+      OperationFuture future =
+          modelServiceClient.createModelOperationCallable().futureCall(request);
+      // Do something.
+      Model response = future.get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_createmodel_lro_async]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModel.java
new file mode 100644
index 000000000000..3b752c2a9648
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModel.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2022 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_modelserviceclient_createmodel_sync]
+import com.google.cloud.retail.v2beta.CatalogName;
+import com.google.cloud.retail.v2beta.CreateModelRequest;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+
+public class SyncCreateModel {
+
+  public static void main(String[] args) throws Exception {
+    syncCreateModel();
+  }
+
+  public static void syncCreateModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      CreateModelRequest request =
+          CreateModelRequest.newBuilder()
+              .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+              .setModel(Model.newBuilder().build())
+              .setDryRun(true)
+              .build();
+      Model response = modelServiceClient.createModelAsync(request).get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_createmodel_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModelCatalognameModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModelCatalognameModel.java
new file mode 100644
index 000000000000..3ecba4ba2666
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModelCatalognameModel.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2022 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_modelserviceclient_createmodel_catalognamemodel_sync]
+import com.google.cloud.retail.v2beta.CatalogName;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+
+public class SyncCreateModelCatalognameModel {
+
+  public static void main(String[] args) throws Exception {
+    syncCreateModelCatalognameModel();
+  }
+
+  public static void syncCreateModelCatalognameModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+      Model model = Model.newBuilder().build();
+      Model response = modelServiceClient.createModelAsync(parent, model).get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_createmodel_catalognamemodel_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModelStringModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModelStringModel.java
new file mode 100644
index 000000000000..14403d66630f
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/createmodel/SyncCreateModelStringModel.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2022 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_modelserviceclient_createmodel_stringmodel_sync]
+import com.google.cloud.retail.v2beta.CatalogName;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+
+public class SyncCreateModelStringModel {
+
+  public static void main(String[] args) throws Exception {
+    syncCreateModelStringModel();
+  }
+
+  public static void syncCreateModelStringModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+      Model model = Model.newBuilder().build();
+      Model response = modelServiceClient.createModelAsync(parent, model).get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_createmodel_stringmodel_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/AsyncDeleteModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/AsyncDeleteModel.java
new file mode 100644
index 000000000000..210fb804bdea
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/AsyncDeleteModel.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2022 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_modelserviceclient_deletemodel_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.retail.v2beta.DeleteModelRequest;
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.protobuf.Empty;
+
+public class AsyncDeleteModel {
+
+  public static void main(String[] args) throws Exception {
+    asyncDeleteModel();
+  }
+
+  public static void asyncDeleteModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      DeleteModelRequest request =
+          DeleteModelRequest.newBuilder()
+              .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+              .build();
+      ApiFuture future = modelServiceClient.deleteModelCallable().futureCall(request);
+      // Do something.
+      future.get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_deletemodel_async]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModel.java
new file mode 100644
index 000000000000..5ec711fb0c17
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModel.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2022 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_modelserviceclient_deletemodel_sync]
+import com.google.cloud.retail.v2beta.DeleteModelRequest;
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.protobuf.Empty;
+
+public class SyncDeleteModel {
+
+  public static void main(String[] args) throws Exception {
+    syncDeleteModel();
+  }
+
+  public static void syncDeleteModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      DeleteModelRequest request =
+          DeleteModelRequest.newBuilder()
+              .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+              .build();
+      modelServiceClient.deleteModel(request);
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_deletemodel_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModelModelname.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModelModelname.java
new file mode 100644
index 000000000000..46198073ba38
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModelModelname.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2022 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_modelserviceclient_deletemodel_modelname_sync]
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.protobuf.Empty;
+
+public class SyncDeleteModelModelname {
+
+  public static void main(String[] args) throws Exception {
+    syncDeleteModelModelname();
+  }
+
+  public static void syncDeleteModelModelname() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
+      modelServiceClient.deleteModel(name);
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_deletemodel_modelname_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModelString.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModelString.java
new file mode 100644
index 000000000000..1651c8cf1d92
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/deletemodel/SyncDeleteModelString.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2022 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_modelserviceclient_deletemodel_string_sync]
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.protobuf.Empty;
+
+public class SyncDeleteModelString {
+
+  public static void main(String[] args) throws Exception {
+    syncDeleteModelString();
+  }
+
+  public static void syncDeleteModelString() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      String name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString();
+      modelServiceClient.deleteModel(name);
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_deletemodel_string_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/AsyncListModels.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/AsyncListModels.java
new file mode 100644
index 000000000000..2ea022670de9
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/AsyncListModels.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2022 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_modelserviceclient_listmodels_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.retail.v2beta.CatalogName;
+import com.google.cloud.retail.v2beta.ListModelsRequest;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+
+public class AsyncListModels {
+
+  public static void main(String[] args) throws Exception {
+    asyncListModels();
+  }
+
+  public static void asyncListModels() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      ListModelsRequest request =
+          ListModelsRequest.newBuilder()
+              .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+              .setPageSize(883849137)
+              .setPageToken("pageToken873572522")
+              .build();
+      ApiFuture future = modelServiceClient.listModelsPagedCallable().futureCall(request);
+      // Do something.
+      for (Model element : future.get().iterateAll()) {
+        // doThingsWith(element);
+      }
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_listmodels_async]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/AsyncListModelsPaged.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/AsyncListModelsPaged.java
new file mode 100644
index 000000000000..a61b2269d56e
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/AsyncListModelsPaged.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2022 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_modelserviceclient_listmodels_paged_async]
+import com.google.cloud.retail.v2beta.CatalogName;
+import com.google.cloud.retail.v2beta.ListModelsRequest;
+import com.google.cloud.retail.v2beta.ListModelsResponse;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.common.base.Strings;
+
+public class AsyncListModelsPaged {
+
+  public static void main(String[] args) throws Exception {
+    asyncListModelsPaged();
+  }
+
+  public static void asyncListModelsPaged() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      ListModelsRequest request =
+          ListModelsRequest.newBuilder()
+              .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+              .setPageSize(883849137)
+              .setPageToken("pageToken873572522")
+              .build();
+      while (true) {
+        ListModelsResponse response = modelServiceClient.listModelsCallable().call(request);
+        for (Model element : response.getModelsList()) {
+          // doThingsWith(element);
+        }
+        String nextPageToken = response.getNextPageToken();
+        if (!Strings.isNullOrEmpty(nextPageToken)) {
+          request = request.toBuilder().setPageToken(nextPageToken).build();
+        } else {
+          break;
+        }
+      }
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_listmodels_paged_async]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModels.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModels.java
new file mode 100644
index 000000000000..434cfd197636
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModels.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2022 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_modelserviceclient_listmodels_sync]
+import com.google.cloud.retail.v2beta.CatalogName;
+import com.google.cloud.retail.v2beta.ListModelsRequest;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+
+public class SyncListModels {
+
+  public static void main(String[] args) throws Exception {
+    syncListModels();
+  }
+
+  public static void syncListModels() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      ListModelsRequest request =
+          ListModelsRequest.newBuilder()
+              .setParent(CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString())
+              .setPageSize(883849137)
+              .setPageToken("pageToken873572522")
+              .build();
+      for (Model element : modelServiceClient.listModels(request).iterateAll()) {
+        // doThingsWith(element);
+      }
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_listmodels_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModelsCatalogname.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModelsCatalogname.java
new file mode 100644
index 000000000000..0040dcaca6bb
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModelsCatalogname.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2022 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_modelserviceclient_listmodels_catalogname_sync]
+import com.google.cloud.retail.v2beta.CatalogName;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+
+public class SyncListModelsCatalogname {
+
+  public static void main(String[] args) throws Exception {
+    syncListModelsCatalogname();
+  }
+
+  public static void syncListModelsCatalogname() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      CatalogName parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]");
+      for (Model element : modelServiceClient.listModels(parent).iterateAll()) {
+        // doThingsWith(element);
+      }
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_listmodels_catalogname_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModelsString.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModelsString.java
new file mode 100644
index 000000000000..fe68a721ef37
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/listmodels/SyncListModelsString.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2022 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_modelserviceclient_listmodels_string_sync]
+import com.google.cloud.retail.v2beta.CatalogName;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+
+public class SyncListModelsString {
+
+  public static void main(String[] args) throws Exception {
+    syncListModelsString();
+  }
+
+  public static void syncListModelsString() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      String parent = CatalogName.of("[PROJECT]", "[LOCATION]", "[CATALOG]").toString();
+      for (Model element : modelServiceClient.listModels(parent).iterateAll()) {
+        // doThingsWith(element);
+      }
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_listmodels_string_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/AsyncPauseModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/AsyncPauseModel.java
new file mode 100644
index 000000000000..c93aa6c0cb1a
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/AsyncPauseModel.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2022 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_modelserviceclient_pausemodel_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.PauseModelRequest;
+
+public class AsyncPauseModel {
+
+  public static void main(String[] args) throws Exception {
+    asyncPauseModel();
+  }
+
+  public static void asyncPauseModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      PauseModelRequest request =
+          PauseModelRequest.newBuilder()
+              .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+              .build();
+      ApiFuture future = modelServiceClient.pauseModelCallable().futureCall(request);
+      // Do something.
+      Model response = future.get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_pausemodel_async]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModel.java
new file mode 100644
index 000000000000..7561dbcb7452
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModel.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2022 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_modelserviceclient_pausemodel_sync]
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.PauseModelRequest;
+
+public class SyncPauseModel {
+
+  public static void main(String[] args) throws Exception {
+    syncPauseModel();
+  }
+
+  public static void syncPauseModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      PauseModelRequest request =
+          PauseModelRequest.newBuilder()
+              .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+              .build();
+      Model response = modelServiceClient.pauseModel(request);
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_pausemodel_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModelModelname.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModelModelname.java
new file mode 100644
index 000000000000..e55d28e5235b
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModelModelname.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2022 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_modelserviceclient_pausemodel_modelname_sync]
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+
+public class SyncPauseModelModelname {
+
+  public static void main(String[] args) throws Exception {
+    syncPauseModelModelname();
+  }
+
+  public static void syncPauseModelModelname() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
+      Model response = modelServiceClient.pauseModel(name);
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_pausemodel_modelname_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModelString.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModelString.java
new file mode 100644
index 000000000000..ef7033c0ba2e
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/pausemodel/SyncPauseModelString.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2022 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_modelserviceclient_pausemodel_string_sync]
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+
+public class SyncPauseModelString {
+
+  public static void main(String[] args) throws Exception {
+    syncPauseModelString();
+  }
+
+  public static void syncPauseModelString() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      String name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString();
+      Model response = modelServiceClient.pauseModel(name);
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_pausemodel_string_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/AsyncResumeModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/AsyncResumeModel.java
new file mode 100644
index 000000000000..181dd18d29e1
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/AsyncResumeModel.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2022 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_modelserviceclient_resumemodel_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.ResumeModelRequest;
+
+public class AsyncResumeModel {
+
+  public static void main(String[] args) throws Exception {
+    asyncResumeModel();
+  }
+
+  public static void asyncResumeModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      ResumeModelRequest request = ResumeModelRequest.newBuilder().setName("name3373707").build();
+      ApiFuture future = modelServiceClient.resumeModelCallable().futureCall(request);
+      // Do something.
+      Model response = future.get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_resumemodel_async]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/SyncResumeModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/SyncResumeModel.java
new file mode 100644
index 000000000000..e9569de5a92a
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/SyncResumeModel.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2022 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_modelserviceclient_resumemodel_sync]
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.ResumeModelRequest;
+
+public class SyncResumeModel {
+
+  public static void main(String[] args) throws Exception {
+    syncResumeModel();
+  }
+
+  public static void syncResumeModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      ResumeModelRequest request = ResumeModelRequest.newBuilder().setName("name3373707").build();
+      Model response = modelServiceClient.resumeModel(request);
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_resumemodel_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/SyncResumeModelString.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/SyncResumeModelString.java
new file mode 100644
index 000000000000..7ebd5af04e56
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/resumemodel/SyncResumeModelString.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2022 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_modelserviceclient_resumemodel_string_sync]
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+
+public class SyncResumeModelString {
+
+  public static void main(String[] args) throws Exception {
+    syncResumeModelString();
+  }
+
+  public static void syncResumeModelString() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      String name = "name3373707";
+      Model response = modelServiceClient.resumeModel(name);
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_resumemodel_string_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/AsyncTuneModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/AsyncTuneModel.java
new file mode 100644
index 000000000000..e1392881e4c2
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/AsyncTuneModel.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2022 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_modelserviceclient_tunemodel_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.TuneModelRequest;
+import com.google.longrunning.Operation;
+
+public class AsyncTuneModel {
+
+  public static void main(String[] args) throws Exception {
+    asyncTuneModel();
+  }
+
+  public static void asyncTuneModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      TuneModelRequest request =
+          TuneModelRequest.newBuilder()
+              .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+              .build();
+      ApiFuture future = modelServiceClient.tuneModelCallable().futureCall(request);
+      // Do something.
+      Operation response = future.get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_tunemodel_async]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/AsyncTuneModelLRO.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/AsyncTuneModelLRO.java
new file mode 100644
index 000000000000..dc17a5e845a9
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/AsyncTuneModelLRO.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2022 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_modelserviceclient_tunemodel_lro_async]
+import com.google.api.gax.longrunning.OperationFuture;
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.TuneModelMetadata;
+import com.google.cloud.retail.v2beta.TuneModelRequest;
+import com.google.cloud.retail.v2beta.TuneModelResponse;
+
+public class AsyncTuneModelLRO {
+
+  public static void main(String[] args) throws Exception {
+    asyncTuneModelLRO();
+  }
+
+  public static void asyncTuneModelLRO() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      TuneModelRequest request =
+          TuneModelRequest.newBuilder()
+              .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+              .build();
+      OperationFuture future =
+          modelServiceClient.tuneModelOperationCallable().futureCall(request);
+      // Do something.
+      TuneModelResponse response = future.get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_tunemodel_lro_async]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModel.java
new file mode 100644
index 000000000000..ff6ed3e5804e
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModel.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2022 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_modelserviceclient_tunemodel_sync]
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.TuneModelRequest;
+import com.google.cloud.retail.v2beta.TuneModelResponse;
+
+public class SyncTuneModel {
+
+  public static void main(String[] args) throws Exception {
+    syncTuneModel();
+  }
+
+  public static void syncTuneModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      TuneModelRequest request =
+          TuneModelRequest.newBuilder()
+              .setName(ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString())
+              .build();
+      TuneModelResponse response = modelServiceClient.tuneModelAsync(request).get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_tunemodel_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModelModelname.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModelModelname.java
new file mode 100644
index 000000000000..3625898a14c8
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModelModelname.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2022 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_modelserviceclient_tunemodel_modelname_sync]
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.TuneModelResponse;
+
+public class SyncTuneModelModelname {
+
+  public static void main(String[] args) throws Exception {
+    syncTuneModelModelname();
+  }
+
+  public static void syncTuneModelModelname() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      ModelName name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]");
+      TuneModelResponse response = modelServiceClient.tuneModelAsync(name).get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_tunemodel_modelname_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModelString.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModelString.java
new file mode 100644
index 000000000000..05d5098de46b
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/tunemodel/SyncTuneModelString.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2022 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_modelserviceclient_tunemodel_string_sync]
+import com.google.cloud.retail.v2beta.ModelName;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.TuneModelResponse;
+
+public class SyncTuneModelString {
+
+  public static void main(String[] args) throws Exception {
+    syncTuneModelString();
+  }
+
+  public static void syncTuneModelString() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      String name = ModelName.of("[PROJECT]", "[LOCATION]", "[CATALOG]", "[MODEL]").toString();
+      TuneModelResponse response = modelServiceClient.tuneModelAsync(name).get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_tunemodel_string_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/AsyncUpdateModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/AsyncUpdateModel.java
new file mode 100644
index 000000000000..63c98f410edf
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/AsyncUpdateModel.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2022 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_modelserviceclient_updatemodel_async]
+import com.google.api.core.ApiFuture;
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.UpdateModelRequest;
+import com.google.protobuf.FieldMask;
+
+public class AsyncUpdateModel {
+
+  public static void main(String[] args) throws Exception {
+    asyncUpdateModel();
+  }
+
+  public static void asyncUpdateModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      UpdateModelRequest request =
+          UpdateModelRequest.newBuilder()
+              .setModel(Model.newBuilder().build())
+              .setUpdateMask(FieldMask.newBuilder().build())
+              .build();
+      ApiFuture future = modelServiceClient.updateModelCallable().futureCall(request);
+      // Do something.
+      Model response = future.get();
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_updatemodel_async]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/SyncUpdateModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/SyncUpdateModel.java
new file mode 100644
index 000000000000..e1be19a1d5f2
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/SyncUpdateModel.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2022 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_modelserviceclient_updatemodel_sync]
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.cloud.retail.v2beta.UpdateModelRequest;
+import com.google.protobuf.FieldMask;
+
+public class SyncUpdateModel {
+
+  public static void main(String[] args) throws Exception {
+    syncUpdateModel();
+  }
+
+  public static void syncUpdateModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      UpdateModelRequest request =
+          UpdateModelRequest.newBuilder()
+              .setModel(Model.newBuilder().build())
+              .setUpdateMask(FieldMask.newBuilder().build())
+              .build();
+      Model response = modelServiceClient.updateModel(request);
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_updatemodel_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/SyncUpdateModelModelFieldmask.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/SyncUpdateModelModelFieldmask.java
new file mode 100644
index 000000000000..689a0a9486e8
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelserviceclient/updatemodel/SyncUpdateModelModelFieldmask.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2022 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_modelserviceclient_updatemodel_modelfieldmask_sync]
+import com.google.cloud.retail.v2beta.Model;
+import com.google.cloud.retail.v2beta.ModelServiceClient;
+import com.google.protobuf.FieldMask;
+
+public class SyncUpdateModelModelFieldmask {
+
+  public static void main(String[] args) throws Exception {
+    syncUpdateModelModelFieldmask();
+  }
+
+  public static void syncUpdateModelModelFieldmask() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    try (ModelServiceClient modelServiceClient = ModelServiceClient.create()) {
+      Model model = Model.newBuilder().build();
+      FieldMask updateMask = FieldMask.newBuilder().build();
+      Model response = modelServiceClient.updateModel(model, updateMask);
+    }
+  }
+}
+// [END retail_v2beta_generated_modelserviceclient_updatemodel_modelfieldmask_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelservicesettings/pausemodel/SyncPauseModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelservicesettings/pausemodel/SyncPauseModel.java
new file mode 100644
index 000000000000..356cef415279
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/modelservicesettings/pausemodel/SyncPauseModel.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2022 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_modelservicesettings_pausemodel_sync]
+import com.google.cloud.retail.v2beta.ModelServiceSettings;
+import java.time.Duration;
+
+public class SyncPauseModel {
+
+  public static void main(String[] args) throws Exception {
+    syncPauseModel();
+  }
+
+  public static void syncPauseModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    ModelServiceSettings.Builder modelServiceSettingsBuilder = ModelServiceSettings.newBuilder();
+    modelServiceSettingsBuilder
+        .pauseModelSettings()
+        .setRetrySettings(
+            modelServiceSettingsBuilder
+                .pauseModelSettings()
+                .getRetrySettings()
+                .toBuilder()
+                .setTotalTimeout(Duration.ofSeconds(30))
+                .build());
+    ModelServiceSettings modelServiceSettings = modelServiceSettingsBuilder.build();
+  }
+}
+// [END retail_v2beta_generated_modelservicesettings_pausemodel_sync]
diff --git a/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/stub/modelservicestubsettings/pausemodel/SyncPauseModel.java b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/stub/modelservicestubsettings/pausemodel/SyncPauseModel.java
new file mode 100644
index 000000000000..13b05aea7ea9
--- /dev/null
+++ b/java-retail/samples/snippets/generated/com/google/cloud/retail/v2beta/stub/modelservicestubsettings/pausemodel/SyncPauseModel.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2022 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_modelservicestubsettings_pausemodel_sync]
+import com.google.cloud.retail.v2beta.stub.ModelServiceStubSettings;
+import java.time.Duration;
+
+public class SyncPauseModel {
+
+  public static void main(String[] args) throws Exception {
+    syncPauseModel();
+  }
+
+  public static void syncPauseModel() throws Exception {
+    // This snippet has been automatically generated for illustrative purposes only.
+    // It may require modifications to work in your environment.
+    ModelServiceStubSettings.Builder modelServiceSettingsBuilder =
+        ModelServiceStubSettings.newBuilder();
+    modelServiceSettingsBuilder
+        .pauseModelSettings()
+        .setRetrySettings(
+            modelServiceSettingsBuilder
+                .pauseModelSettings()
+                .getRetrySettings()
+                .toBuilder()
+                .setTotalTimeout(Duration.ofSeconds(30))
+                .build());
+    ModelServiceStubSettings modelServiceSettings = modelServiceSettingsBuilder.build();
+  }
+}
+// [END retail_v2beta_generated_modelservicestubsettings_pausemodel_sync]